forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop creating linter report files in CI (cvat-ai#6560)
Currently, when one of the linters reports a problem, if you want to see what that problem is, you have to do the following: 1. Click on the "Details" link in the PR. 2. Click "Summary". 3. Click the artifact (also, depending on the browser, choose where to save it). 4. Open the downloaded file (which is an archive). 5. Open the report file from the archive. 6. Delete the archive after you're done. That is far too much hassle, and all it gives you is a slightly fancier- looking report (and sometimes not even that, like in the case of black). So just remove all the report building and uploading. Now the above procedure is reduced to: 1. Click "Details". 2. Expand the appropriate build step.
- Loading branch information
Showing
9 changed files
with
8 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,19 +23,11 @@ jobs: | |
. .env/bin/activate | ||
pip install -U pip wheel setuptools | ||
pip install bandit | ||
mkdir -p bandit_report | ||
echo "Bandit version: "$(bandit --version | head -1) | ||
echo "The files will be checked: "$(echo $CHANGED_FILES) | ||
bandit -a file --ini .bandit -f html -o ./bandit_report/bandit_checks.html $CHANGED_FILES | ||
bandit -a file --ini .bandit $CHANGED_FILES | ||
deactivate | ||
else | ||
echo "No files with the \"py\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: bandit_report | ||
path: bandit_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,23 +33,15 @@ jobs: | |
. .env/bin/activate | ||
pip install -U pip wheel setuptools | ||
pip install $(egrep "black.*" ./cvat-cli/requirements/development.txt) | ||
mkdir -p black_report | ||
echo "Black version: "$(black --version) | ||
echo "The dirs will be checked: $UPDATED_DIRS" | ||
EXIT_CODE=0 | ||
for DIR in $UPDATED_DIRS; do | ||
black --check --diff $DIR >> ./black_report/black_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true | ||
black --check --diff $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true | ||
done | ||
deactivate | ||
exit $EXIT_CODE | ||
else | ||
echo "No files with the \"py\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: black_report | ||
path: black_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,17 +13,8 @@ jobs: | |
run: | | ||
yarn install --frozen-lockfile | ||
(cd tests && yarn install --frozen-lockfile) | ||
yarn add eslint-detailed-reporter -D -W | ||
- name: Run checks | ||
run: | | ||
echo "ESLint version: "$(yarn run -s eslint --version) | ||
mkdir -p eslint_report | ||
yarn run eslint . -f node_modules/eslint-detailed-reporter/lib/detailed.js -o ./eslint_report/eslint_checks.html | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: eslint_report | ||
path: eslint_report | ||
yarn run eslint . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,26 +23,8 @@ jobs: | |
curl -sL -o $HADOLINT "https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VER/hadolint-Linux-x86_64" && chmod 700 $HADOLINT | ||
echo "HadoLint version: "$($HADOLINT --version) | ||
echo "The files will be checked: "$(echo $CHANGED_FILES) | ||
mkdir -p hadolint_report | ||
$HADOLINT --no-fail --format json $CHANGED_FILES > ./hadolint_report/hadolint_report.json | ||
GET_VERIFICATION_LEVEL=$(cat ./hadolint_report/hadolint_report.json | jq -r '.[] | .level') | ||
for LINE in $GET_VERIFICATION_LEVEL; do | ||
if [[ $LINE =~ $VERIFICATION_LEVEL ]]; then | ||
pip install json2html | ||
python ./tests/json_to_html.py ./hadolint_report/hadolint_report.json | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
done | ||
$HADOLINT -t $VERIFICATION_LEVEL $CHANGED_FILES | ||
else | ||
echo "No files with the \"Dockerfile*\" name found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: hadolint_report | ||
path: hadolint_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,23 +30,15 @@ jobs: | |
. .env/bin/activate | ||
pip install -U pip wheel setuptools | ||
pip install $(egrep "isort.*" ./cvat-cli/requirements/development.txt) | ||
mkdir -p isort_report | ||
echo "isort version: $(isort --version-number)" | ||
echo "The dirs will be checked: $UPDATED_DIRS" | ||
EXIT_CODE=0 | ||
for DIR in $UPDATED_DIRS; do | ||
isort --check $DIR >> ./isort_report/isort_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true | ||
isort --check $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true | ||
done | ||
deactivate | ||
exit $EXIT_CODE | ||
else | ||
echo "No files with the \"py\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: isort_report | ||
path: isort_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,24 +23,13 @@ jobs: | |
python3 -m venv .env | ||
. .env/bin/activate | ||
pip install -U pip wheel setuptools | ||
pip install pylint-json2html | ||
pip install $(egrep "pylint.*==.*" ./cvat/requirements/development.txt) | ||
pip install $(egrep "django==.*" ./cvat/requirements/base.txt) | ||
mkdir -p pylint_report | ||
echo "Pylint version: "$(pylint --version | head -1) | ||
echo "The files will be checked: "$(echo $CHANGED_FILES) | ||
pylint $CHANGED_FILES --output-format=json > ./pylint_report/pylint_checks.json || EXIT_CODE=$(echo $?) || true | ||
pylint-json2html -o ./pylint_report/pylint_checks.html ./pylint_report/pylint_checks.json | ||
pylint $CHANGED_FILES | ||
deactivate | ||
exit $EXIT_CODE | ||
else | ||
echo "No files with the \"py\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: pylint_report | ||
path: pylint_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,20 +12,6 @@ jobs: | |
- name: Run checks | ||
run: | | ||
yarn install --frozen-lockfile | ||
mkdir -p remark_report | ||
echo "Remark version: "`npx remark --version` | ||
npx remark --quiet --report json --no-stdout -i .remarkignore . 2> ./remark_report/remark_report.json | ||
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'` | ||
if [[ ! -z ${get_report} ]]; then | ||
pip install json2html | ||
python ./tests/json_to_html.py ./remark_report/remark_report.json | ||
exit 1 | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: remark_report | ||
path: remark_report | ||
npx remark --quiet --frail -i .remarkignore . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,21 +21,10 @@ jobs: | |
if [[ ! -z $CHANGED_FILES ]]; then | ||
yarn install --frozen-lockfile | ||
mkdir -p stylelint_report | ||
echo "StyleLint version: "$(npx stylelint --version) | ||
echo "The files will be checked: "$(echo $CHANGED_FILES) | ||
npx stylelint --formatter json --output-file ./stylelint_report/stylelint_report.json $CHANGED_FILES || EXIT_CODE=$(echo $?) || true | ||
pip install json2html | ||
python ./tests/json_to_html.py ./stylelint_report/stylelint_report.json | ||
exit $EXIT_CODE | ||
npx stylelint $CHANGED_FILES | ||
else | ||
echo "No files with the \"css|scss\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: stylelint_report | ||
path: stylelint_report |
This file was deleted.
Oops, something went wrong.