Skip to content

Commit

Permalink
Add handling of .skip_lint file(s) (#58)
Browse files Browse the repository at this point in the history
* Add handling of a .skip_lint file

that allows to list linters to be skipped. a skip file in the repo root
and in the tool dir are allowed (and joined)
  • Loading branch information
bernt-matthias authored Jul 5, 2024
1 parent 02f62a9 commit 077cb01
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ jobs:
continue-on-error: true
- name: check if all test tools were linted
run: |
set -x
# check if the ToolIDValid linter is called (no of tools - 1 ) times, i.e. is skipped once
if [ "$(grep -c ToolIDValid lint_report.txt)" != "2" ]; then
echo "expecting exactly 2 tests for ToolIDValid"; exit 1;
fi
grep tool1 lint_report.txt
grep tool2 lint_report.txt
grep "ERROR: Error 'HTTPConnectionPool" lint_report.txt
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Tools/workflows in a path that has a prefix in:

Tools and workflows are discovered in all directories, except for `packages/` and `deprecated/`. These directories may be absent.

A global `.lint_skip` file and per repo `.lint_skip` files can be used to list tool/workflow linters that should be skipped.

Setup mode
----------

Expand Down
5 changes: 4 additions & 1 deletion planemo_ci_actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ fi
# - check if each tool is in a repo (i.e. if `.shed.yml` is present)
if [ "$MODE" == "lint" ]; then
lint_fail=false
touch .lint_skip
mapfile -t REPO_ARRAY < repository_list.txt
for DIR in "${REPO_ARRAY[@]}"; do
if [ "$WORKFLOWS" != "true" ]; then
(planemo shed_lint --tools --ensure_metadata --urls --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" --recursive "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt) || lint_fail=true
cat .lint_skip >> "$DIR"/.lint_skip
cat "$DIR"/.lint_skip
(planemo shed_lint --tools --ensure_metadata --urls --skip_file "$DIR"/.lint_skip --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" --recursive "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt) || lint_fail=true
else
(planemo workflow_lint --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt) || lint_fail=true
fi
Expand Down
1 change: 1 addition & 0 deletions test/tools/tool1/.lint_skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ToolIDValid

0 comments on commit 077cb01

Please sign in to comment.