tools/backport_pr: fix checks run by tox #14438
Merged
miri64 merged 3 commits intoRIOT-OS:masterfrom Jul 4, 2020
Merged
Conversation
miri64
reviewed
Jul 4, 2020
Member
miri64
left a comment
There was a problem hiding this comment.
LGTM but could use some documentation for posterity.
miri64
approved these changes
Jul 4, 2020
Member
miri64
left a comment
There was a problem hiding this comment.
ACK. tox passes on my machine
Details
test installed: agithub==2.1,attrs==19.3.0,gitdb2==2.0.3,GitPython==2.1.9,more-itertools==8.4.0,packaging==20.4,pluggy==0.13.1,py==1.9.0,pyparsing==2.4.7,pytest==5.4.3,six==1.15.0,smmap2==2.0.3,wcwidth==0.2.5
test run-test-pre: PYTHONHASHSEED='1405377039'
test run-test: commands[0] | pytest -v --doctest-modules backport_pr.py
===================================================================== test session starts ======================================================================
platform linux -- Python 3.8.3, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/backport_pr/.tox/test/bin/python
cachedir: .tox/test/.pytest_cache
rootdir: /home/mlenders/Repositories/RIOT-OS/RIOT/dist/tools/backport_pr
collected 3 items
backport_pr.py::backport_pr._branch_name_strip PASSED [ 33%]
backport_pr.py::backport_pr._get_labels PASSED [ 66%]
backport_pr.py::backport_pr._get_latest_release PASSED [100%]
====================================================================== 3 passed in 0.11s =======================================================================
lint installed: agithub==2.1,astroid==2.4.2,gitdb2==2.0.3,GitPython==2.1.9,isort==4.3.21,lazy-object-proxy==1.4.3,mccabe==0.6.1,pylint==2.5.3,six==1.15.0,smmap2==2.0.3,toml==0.10.1,wrapt==1.12.1
lint run-test-pre: PYTHONHASHSEED='1405377039'
lint run-test: commands[0] | pylint --disable=fixme backport_pr.py
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.17/10, +0.83)
flake8 installed: flake8==3.8.3,mccabe==0.6.1,pycodestyle==2.6.0,pyflakes==2.2.0
flake8 run-test-pre: PYTHONHASHSEED='1405377039'
flake8 run-test: commands[0] | flake8 --max-complexity=25 backport_pr.py
___________________________________________________________________________ summary ____________________________________________________________________________
test: commands succeeded
lint: commands succeeded
flake8: commands succeeded
congratulations :)
- ignore fixme warning with pylint - increase tolerated code complexity for flake8
24550a9 to
dfa9979
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contribution description
This PR fixes the checks performed by tox on the backport_pr script. The changes applied here are minimal (rename variables, add missing docstrings, use
sys.exitinstead ofexit.Since most of the complexity of the script is in the
main, I chose to silent the complexity related errors when invoking flake8 and pylint. We could keep the previous parameters but that would mean a complete rewrite of the script.This PR also adds a docstring test to the
_get_latest_releasefunction.Testing procedure
Run
toxfrom thedist/tools/backport_prdirectory:this PR:
master:
Issues/PRs references
None