From 0df1565532540487f8fb2ba72ddc89d15547b3d8 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 16:33:45 -0800 Subject: [PATCH] Remove ci_lint.sh After the previous commit, it doesn't do much, only passes the linting exceptions file on the command line. Instead, make the lint.exceptions file the default for that argument (if it exists), and remove the shell script. --- .github/workflows/checks-main.yml | 2 +- .github/workflows/checks-pr.yml | 2 +- tools/lint/lint.py | 6 +++++- tools/scripts/ci_lint.sh | 7 ------- 4 files changed, 7 insertions(+), 10 deletions(-) delete mode 100755 tools/scripts/ci_lint.sh diff --git a/.github/workflows/checks-main.yml b/.github/workflows/checks-main.yml index fb1e725d88..259de1c2f4 100644 --- a/.github/workflows/checks-main.yml +++ b/.github/workflows/checks-main.yml @@ -25,4 +25,4 @@ jobs: run: ./tools/lint/test/run.py - name: Lint all tests - run: ./tools/scripts/ci_lint.sh + run: ./tools/lint/lint.py test/ diff --git a/.github/workflows/checks-pr.yml b/.github/workflows/checks-pr.yml index f21411ad77..ee6d2b5464 100644 --- a/.github/workflows/checks-pr.yml +++ b/.github/workflows/checks-pr.yml @@ -39,4 +39,4 @@ jobs: for file in $CHANGED; do echo $file done - ./tools/scripts/ci_lint.sh $CHANGED + ./tools/lint/lint.py $CHANGED diff --git a/tools/lint/lint.py b/tools/lint/lint.py index 9f0dca2811..b8eaa86e86 100755 --- a/tools/lint/lint.py +++ b/tools/lint/lint.py @@ -97,7 +97,11 @@ if __name__ == '__main__': if args.exceptions: exceptions = lib.exceptions.parse(args.exceptions) else: - exceptions = dict() + try: + with open('lint.exceptions', 'r') as default_exceptions: + exceptions = lib.exceptions.parse(default_exceptions) + except FileNotFoundError: + exceptions = dict() files = [path for _path in args.path for path in collect_files(_path)] file_count = len(files) diff --git a/tools/scripts/ci_lint.sh b/tools/scripts/ci_lint.sh deleted file mode 100755 index 019ce9225b..0000000000 --- a/tools/scripts/ci_lint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ "$#" -eq 0 ]; then - set -- test/ -fi - -./tools/lint/lint.py --exceptions lint.exceptions $@