Wakoma / nimble

The nimble. An open source, rapidly deployable, wireless mesh network.
CERN Open Hardware Licence Version 2 - Strongly Reciprocal
56 stars 9 forks source link

Improve GitHub Actions #56

Closed julianstirling closed 1 month ago

julianstirling commented 1 month ago

The goal of this PR is to improve the GitHub Actions to

julianstirling commented 1 month ago

Hi @jmwright I have added two lining jobs. One lints Python files that are not directly run by cq-cli. The other lints these CadQuery scripts.

The reason they are linted separately is they require different pylint rc files. For CadQuery I have made a custom rc file that:

Running lint-test.py is documented in the help you get when you run ./lint-test.py -h

Merging when failing!?

The CI is failing because the code has some issues that the linter has found. I think it makes sense to merge this now so that we have linting happening. And then we can open another PR to fix errors.

julianstirling commented 1 month ago

Thanks @jmwright

I think the main difference from black to pylint is that black automatically formats your code (unless they added more features since I last checked). Pylint doesn't actually edit the code, it just complains if things are bad. But it is designed to do far more checks to warn you about possible bugs and unsafe code.

I'm in the middle of doing a first pass fixing some things now. Once I have done that there may be some more things to fix

jmwright commented 1 month ago

black automatically formats your code

Many projects run black --diff --check . to check the code without editing it. This is especially useful in CI.

julianstirling commented 1 month ago

Thanks, but I think black still only checks the formatting. Not things like if variables are undefined?

jmwright commented 1 month ago

Correct, I do not think that black checks the code to the extent that pylint does.