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

Remove --check flags from pre-commit config #261

Merged
merged 6 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ repos:
rev: 5.12.0
hooks:
- id: isort
entry: poetry run isort --check
entry: poetry run isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
entry: poetry run black --check
entry: poetry run black
- repo: https://github.com/pycqa/flake8
rev: 5.0.0
hooks:
Expand Down
11 changes: 7 additions & 4 deletions docs/reference/developer_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,20 @@ The CI process for developers' local clones and the remote repository should be

### Local

Local CI is done automatically when pushing with `.pre-commit-config.yaml`, which runs *static* tests that can be run manually with the following command.
Local CI is done automatically when comitting with `.pre-commit-config.yaml`, which runs *static* tests against staged files and generates fixes as possible. If the pre-commit checks fail the generated fixes can be inspected and staged as desired before attempting to commit again.


The command below will test files and generate fixes to formatting errors in files (running without `-a` will only fix staged files) without generating a commit upon successful completion.
```
pre-commit run -a
```

Pre-commit commands can be run individually with the following commands. Configuration of `isort`, `black`, and `mypy` are done in [pyproject.toml](https://github.com/NREL/BuildingMOTIF/blob/develop/pyproject.toml) and configuration of `flake8` is done in [.flake8](https://github.com/NREL/BuildingMOTIF/blob/develop/.flake8).
```
poetry run isort --check
poetry run black --check
poetry run isort
poetry run black
poetry run flake8 buildingmotif
poetry run mypy
poetry run mypy --install-types --non-interactive --ignore-missing-imports
```

The above does not include *dynamic* testing (unit and integration), which can be run manually with the following command. To run tests with DEBUG prints add the `-o log_cli=true` argument to the command
Expand Down