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

Solidify Tests and Code Consistency #39

Open
4 tasks
Bluesy1 opened this issue Jun 15, 2023 · 1 comment · May be fixed by #40
Open
4 tasks

Solidify Tests and Code Consistency #39

Bluesy1 opened this issue Jun 15, 2023 · 1 comment · May be fixed by #40

Comments

@Bluesy1
Copy link
Collaborator

Bluesy1 commented Jun 15, 2023

Following up on #37, a few minor details were left unfinished:

  • Set up a pre commit config to run tests/linting locally
  • Define any linting parameters
  • Setup code coverage to track how effective our current tests are
    • Setup Coverage reporting, potentially with a tool like codecov (based on the badge in the readme)

Linting:

  • What tools?
    • Python
      • Black is the basically defacto standard for python these days, normally a bit of tweaking is needed due to its highly opinionated defaults
      • A few defaults probably need to be changed, i.e. line length - default from black is PEP8's 79 characters, which I think is too short, I personally prefer 100 or 120 characters, which should still fit on most modern screens
    • Markdown
      • Prettier.io?
  • If we are to do this, do we at actions to enforce the conventions?

Code Coverage:

Since we use pytest, the obvious choice is to use their first party coverage tool, pytest-cov.

For reporting coverage, we could generate an html report and upload it as an artifact, find some tool that works in a workflow to export it in a way we can leave a commit comment/status, or use a 3rd party tool like codecov.

Pre-commit

I'm not a huge fan of running tests in a pre-commit hook, rather in a pre-push hook, especially as more tests are added, time can build up and it can slow down commits (though, that may not be an issue here, the tests seem to run quickly for me), though I cannot deny it being more useful than having to open up a terminal and run things like poetry run pytest, poetry run black, etc for any tools being used.

@firasm
Copy link
Contributor

firasm commented Jun 15, 2023

I think we can skip pre-commit in this repo for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants