Skip to content

Add pytest CI and pre-commit#9

Open
Illviljan wants to merge 6 commits intodkuschmierz:mainfrom
Illviljan:pre_commit
Open

Add pytest CI and pre-commit#9
Illviljan wants to merge 6 commits intodkuschmierz:mainfrom
Illviljan:pre_commit

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