Files
compute-runtime/scripts/lint/set_copyright.sh
Artur Harasimiuk 803a946e3f cmake: add lint target
This wraps around commands used to format code and exposes them as
single build system target: 'lint'.

Change-Id: Ide88b8f080582221b1832be06fd2fd0f2cd44ab4
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-19 16:14:31 +02:00

16 lines
399 B
Bash
Executable File

#!/bin/bash
#
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
converter=$(dirname $(readlink -f $0))/set_copyright.py
if [ "${1:-STAGED}" = "HEAD" ]; then
git diff-tree --no-commit-id --name-only -r HEAD | xargs -n 1 python $converter
else
git diff --cached --name-only | xargs -n 1 python $converter
git diff --name-only | xargs -n 1 echo "Not scanned: "
fi