Skip to content

Conversation

@arm4b
Copy link
Contributor

@arm4b arm4b commented Dec 12, 2022

Based on the previous PRs, sometimes the linting error messages are not clear enough.
Add problem matches to Github Actions so we can highlight the warnings and errors directly in the PR code diff for specific file:line from pylint and black CI runs.

See: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
See: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md

The Result

Pylint:
image

Black:
image

So there's no need to go into the GH Action Details URL, as the result is just ^^ there.

This PR also splits black vs pylint in the GH Actions so the failure is more clear:
image

@arm4b arm4b added enhancement ✨ New feature or request tests CI/CD labels Dec 12, 2022
@arm4b arm4b added this to the v2.3.0 milestone Dec 12, 2022
@arm4b arm4b force-pushed the ci/lint-annotations branch 5 times, most recently from 79e18c9 to 0cda4e1 Compare December 12, 2022 22:10
@arm4b arm4b force-pushed the ci/lint-annotations branch from 0cda4e1 to 87ba9ee Compare December 12, 2022 22:12
@arm4b arm4b marked this pull request as ready for review December 12, 2022 22:20
@arm4b arm4b enabled auto-merge (squash) December 19, 2022 12:51
Copy link
Contributor

@LeoDiazL LeoDiazL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

~/.cache/pip
.tox
key: ${{ runner.os }}-v1-python-3.8-${{ hashFiles('requirements.txt', 'test-requirements.txt', 'pyproject.toml', 'tox.ini') }}
key: ${{ runner.os }}-v1-python-3.8-black-${{ hashFiles('test-requirements.txt', 'pyproject.toml', 'tox.ini') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-requirements.txt -> requirements.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that's as expected. back depends only on the test-requirements.txt, - that's where we define it as a test/dev dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pylint (below) also needs requirements.txt as it does more in-depth code analysis for the project, including its pip dependencies.

import os
import git
import yaml
import non_existent_module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just to illustrate that the UI formatting works?
Either way this should be removed before merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's for illustration for you folks to get an idea of how it looks like in the PR code diff.

Will remove it before merging and also plan to squash all the commits as there's a lot of commit noise in this PR.

@arm4b arm4b merged commit a506cd4 into main Dec 19, 2022
@arm4b arm4b deleted the ci/lint-annotations branch December 19, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD enhancement ✨ New feature or request tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants