Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling of .skip_lint file(s) #58

Merged
merged 8 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ 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
grep "Applying linter tests... CHECK" lint_report.txt
grep "TestsNoValid" lint_report.txt
test-tools:
name: Test testing of tools
needs: [setup-ci-tools]
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
Loading