Skip to content

GitHub Action to lint Python code#57

Closed
cclauss wants to merge 5 commits into
richpl:masterfrom
cclauss:patch-1
Closed

GitHub Action to lint Python code#57
cclauss wants to merge 5 commits into
richpl:masterfrom
cclauss:patch-1

Conversation

@cclauss

@cclauss cclauss commented Oct 26, 2021

Copy link
Copy Markdown
Contributor

Test results: https://github.com/cclauss/PyBasic/actions

bandit, codespell, flake8, mypy, pytest, and safety are all currently setup as mandatory tests.

Fixes a failing doctest: FlowSignal(ftype=FlowSignal.RETURN).ftarget is None, not -1

$ pytest --doctest-modules .

============================= test session starts ==============================
platform linux -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/runner/work/PyBasic/PyBasic
collected 2 items

flowsignal.py .                                                          [ 50%]
lexer.py .                                                               [100%]

============================== 2 passed in 0.07s ===============================

bandit, codespell, flake8, mypy, and pytest are currently mandatory tests.
`FlowSignal(ftype=FlowSignal.RETURN).ftarget`  is `None`, not `-1`
@richpl

richpl commented Nov 7, 2021

Copy link
Copy Markdown
Owner

I agree that there is a lot of shoddy code out there and we should be encouraging people to properly test and validate their code, but I'm a little nervous about making all of those tools mandatory. At the end of the day, this is a hobbyist project and I don't want to raise the bar too high for people to contribute. I'm aware that I'm not familiar with the tools you have listed so this is partly my own ignorance talking here too.

I shall definitely check these tools out and get more familiar with them. But until then I'm nervous about mandating their use.

* bandit -- Security issues
* codespell - Spell checker
* flake8 - Lint
* mypy - Check data types
* pytest - Run our tests
@cclauss

cclauss commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

Slim down to just a few tools

  • bandit -- Security issues
  • codespell - Spell checker
  • flake8 - Lint
  • mypy - Check data types
  • pytest - Run our tests

cclauss added a commit to cclauss/PyBasic that referenced this pull request Nov 8, 2021
Based on the feedback at richpl#57 (comment), a GitHub Action that only runs pytest.  https://github.com/pytest-dev/pytest#readme

Test results: https://github.com/cclauss/PyBasic/actions
Fixes a failing doctest: `FlowSignal(ftype=FlowSignal.RETURN).ftarget`  is `None`, not `-1`

$ `pytest --doctest-modules .`
```
============================= test session starts ==============================
platform linux -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/runner/work/PyBasic/PyBasic
collected 2 items

flowsignal.py .                                                          [ 50%]
lexer.py .                                                               [100%]

============================== 2 passed in 0.07s ===============================
```
@cclauss cclauss closed this Nov 15, 2021
@cclauss cclauss deleted the patch-1 branch November 15, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants