-
Notifications
You must be signed in to change notification settings - Fork 17
Revive pylint support, and a first batch for fixes for problems found #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4095da
.gitignore: cleanup of entry that has become wrong
ydirson 66ef25b
run-pylint: fix source directory name name
ydirson ad8ae84
run-pylint: remove creation of xcp symlink, with no effect any more
ydirson d39755f
run-pylint: allow using arbitrary options
ydirson 64be3cd
pylint: use standard rc file name to remove the need for --rcfile
ydirson 2f08f38
xcp.accessor: fix "false" typo (pylint)
ydirson e389e9c
cpiofile: fix non-literal option name (pylint)
ydirson f6776fe
cpiofile: make it explicit that init() is implemented by subclasses
ydirson ca23b05
CI: run pylint
ydirson c5359d6
CI: run diff-quality against master
ydirson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Unit tests | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| test_py2: | ||
| runs-on: ubuntu-20.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python 2.7 | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: '2.7' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pylint diff_cover | ||
|
|
||
| - name: Pylint | ||
| run: | | ||
| pylint --version | ||
| pylint --exit-zero xcp/ tests/ setup.py | ||
| pylint --exit-zero --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" xcp/ tests/ setup.py > pylint.txt | ||
| diff-quality --violations=pylint --html-report pylint-diff.html pylint.txt | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: Pylint diff | ||
| path: pylint-diff.html |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,9 +3,3 @@ | |
|
|
||
| # Emacs backup files | ||
| *~ | ||
|
|
||
| # 'xcp' symlink for test harness | ||
| /tests/xcp | ||
|
|
||
| # 'xcp' symlink for pylint | ||
| /xcp | ||
File renamed without changes.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| test -r xcp || ln -sf . xcp | ||
|
|
||
| if [[ -z $1 ]]; then | ||
| pylint --rcfile=pylint.rc *.py net | ||
| if [ $# = 0 ]; then | ||
| pylint *.py xcp | ||
| else | ||
| pylint --rcfile=pylint.rc $1 | ||
| pylint "$@" | ||
| fi |
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be done via some of the
@abcannotations in python, would https://docs.python.org/3/library/abc.html#abc.abstractmethod (and inheriting from the proper ABC class) fix the pylint warning too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using abc works just as well. That one is annoying in projects making heavy use of metaclasses (which is why I default to the exception idiom), but it will do the job here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, inheriting from
abc.ABCcomes with 3.4 only, so we'd have to use something like@six.add_metaclass(abc.ABCMeta)for a 2/3-portable idiom, which I feel brings too much complexity, for no clear advantage overNotImplementedError(). What do you think ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd concur with that. My feeling is we want the Py2/Py3 compatibility phase to be relatively short until the migration is complete and then drop the py2 support completely at which point there can be a follow on set of changes to perform code cleanups.