-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IN-896 App stabilization: add linters and pre-commit hooks
Why these changes are being introduced: * We updated our method for managing linters and code formatting for our Python projects to simplify configuration and use. How this addresses that need: * Apply standard pyproject.toml file * Deprecate setup.cfg * Apply linting with Ruff * Set black, mypy, ruff, and safety as linters * Add pre-commit hooks * Update Makefile * Update Pipfile Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-896
- Loading branch information
1 parent
edf936f
commit 266f084
Showing
12 changed files
with
355 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
default_language_version: | ||
python: python3.11 # set for project python version | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: black-apply | ||
name: black-apply | ||
entry: pipenv run black | ||
language: system | ||
pass_filenames: true | ||
types: ["python"] | ||
- id: mypy | ||
name: mypy | ||
entry: pipenv run mypy | ||
exclude: tests/ | ||
language: system | ||
pass_filenames: true | ||
types: ["python"] | ||
- id: ruff-apply | ||
name: ruff-apply | ||
entry: pipenv run ruff check --fix | ||
language: system | ||
pass_filenames: true | ||
types: ["python"] | ||
- id: safety | ||
name: safety | ||
entry: pipenv check | ||
language: system | ||
pass_filenames: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.