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 pytest CI and pre-commit #9

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Jan 8, 2023

Add a pytest CI with different OS'.

  • When I run the tests on my windows pc the tests fail because of os.linesep.

This adds https://pre-commit.com/ to the project.

I suggest to also add pre-commit to the CI, https://pre-commit.ci/, so new contributors doesn't have to install pre-commit and run it themself.
I think only maintainers can activate the pre-commit.ci though.

Locally the workflow is:

  • cd to dcmReader root directory
  • Run pre-commit run --all-files --hook-stage manual

The config was based on:

Notable things:

  • Clean up trailing whitespace etc.
  • Enforce absolute imports with absolufy-imports.
  • Use ruff for various stuff
  • Use black to autoformat the code. Format also docstring examples with blackdoc.
  • Run mypy to check type hints. Requires adding --hook-stage manual as it can be slow. There should be a separate workflow for mypy in the CI.

@Illviljan Illviljan changed the title Add pre-commit config Add pytest CI and pre-commit Jan 28, 2023
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.

1 participant