Skip to content
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

Add static code analysis to GitHub Actions #73

Closed
John-Sharples opened this issue Oct 16, 2023 · 4 comments
Closed

Add static code analysis to GitHub Actions #73

John-Sharples opened this issue Oct 16, 2023 · 4 comments

Comments

@John-Sharples
Copy link
Contributor

John-Sharples commented Oct 16, 2023

Is your feature request related to a problem? Please describe.
To ensure consistent style and code quality we need to add some static code checks. Requested feature is to add new github action to run static code analysis, including black, pylint, isort, and mypy.

Describe the solution you'd like
New GitHub actions to run above mentioned tools automatically on push and pull-request.

Happy to be assigned to this task

@tennlee
Copy link
Collaborator

tennlee commented Oct 16, 2023

Looks like a great start, but where does the coverage report end up? I couldn't work out how to actually put the output report somewhere in a nicely viewable way. It's worthwhile regardless, but it would be ncie to have easily viewable results

@John-Sharples
Copy link
Contributor Author

John-Sharples commented Oct 16, 2023

These changes just get the coverage working. Currently pytest raises this warning CoverageWarning: No data was collected. (no-data-collected) and there's no coverage reported. I've added an extra task to specifically report coverage in the job output, so you can click through and find it there.

If we want to adopt a third party tool to make it a bit more visible, there's several options, eg:

Happy to work on adding one of these too, if we can decide what we want.

@tennlee
Copy link
Collaborator

tennlee commented Oct 16, 2023

That makes sense. I'm aware of the third-party approached to coverage reporting. They provide some nice additional features, but it's also an additional technology to maintain. I'm open to it, but let's have that discussion about what we want after closing out the current issue?

@aidanjgriffiths
Copy link
Collaborator

aidanjgriffiths commented Nov 2, 2023

@John-Sharples I fixed the no coverage collected issue in #87. It had to do with requiring an editable install as pytest-cov points to the local repo files instead of the installation files in /usr/bin or venv. Somehow coverage manages this case where `pytest-cov doesn't.

As for badges, I had a look at how to implement badges in actions and it is such a stuff around compared to gitlab that I don't even want to try 😄.

As for this I think we could close this issue since pre-commit and tests have been implemented in the develop pipeline already.

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

No branches or pull requests

3 participants