File: lint_pull_request.sh

package info (click to toggle)
aseba-plugin-blockly 20180211%2Bgit-3
  • links: PTS
  • area: non-free
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 64,568 kB
  • sloc: javascript: 504,479; xml: 7,976; python: 2,314; sh: 261; lisp: 24; makefile: 10
file content (18 lines) | stat: -rwxr-xr-x 596 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#
# Script to run the Compiler's Linter on only the modified or added files in the
# current branch. Should be run from the base git directory with the PR branch
# checked out.

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM master..$CURRENT_BRANCH |
    grep -E "\.js$" |
    grep -v -E "test\.js$" |
    grep -v -f scripts/ci/lint_ignore.txt)

if [[ -n "$CHANGED_FILES" ]]; then
  set -x
  java -jar ../closure-compiler-linter-1.0-SNAPSHOT.jar $CHANGED_FILES
else
  echo "No .js files found to lint in this Pull Request."
fi