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

linter workflow: fix linter change test on test_package #15500

Merged
merged 11 commits into from
Feb 1, 2023
28 changes: 6 additions & 22 deletions .github/workflows/linter-conan-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,18 @@ jobs:
if: steps.changed_files.outputs.any_changed == 'true'
run: |
echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY
i=1
for file in recipes/*/*/conanfile.py; do
if [[ $i -gt 250 ]] ; then
break
fi
echo "$i - $file"
pylint --rcfile=linter/pylintrc_recipe $file --output-format=json --output=recipes.json --score=y --exit-zero
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' recipes.json > recipes2.json
jq -r '" * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY
(( i += 1 ))
done
pylint --rcfile=linter/pylintrc_recipe `ls recipes/*/*/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --score=y --exit-zero
jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json
jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY

- name: Execute linter over all test_package/recipes in the repository
id: linter_test_package
if: steps.changed_files.outputs.any_changed == 'true'
run: |
echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY
i=1
for file in recipes/*/*/conanfile.py; do
if [[ $i -gt 250 ]] ; then
break
fi
echo "$i - $file"
pylint --rcfile=linter/pylintrc_testpackage $file --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py --output-format=json --output=recipes.json --exit-zero
jq 'map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}' recipes.json > recipes2.json
jq -r '" * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY
(( i += 1 ))
done
pylint --rcfile=linter/pylintrc_testpackage `ls recipes/*/*/test_package/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --exit-zero
jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json
jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY

conanfile_recipe:
name: Lint changed conanfile.py (v2 migration)
Expand Down