Skip to content

Commit

Permalink
Add pre-commit configuration
Browse files Browse the repository at this point in the history
- Also fixes pre-commit errors

Signed-off-by: John Strunk <[email protected]>
  • Loading branch information
JohnStrunk committed Mar 23, 2023
1 parent 226aab5 commit 1d37c85
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jobs:
shell: cmd
run: pipenv install --deploy --dev --no-site-packages -v

- name: Run pre-commit checks
shell: cmd
run: pipenv run pre-commit run -a

- name: Run tests
shell: cmd
run: pipenv run pytest -v
Expand Down
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

# Install in your local dev environment
# > pip install --upgrade --user pre-commit
# Enable the hooks for this repo
# > pre-commit install

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files # prevents giant files from being committed
- id: check-yaml # checks yaml files for parseable syntax
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline
- id: trailing-whitespace # trims trailing whitespace
exclude: startlist_test.py # Test data has intentional EOL whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
hooks:
- id: mypy
additional_dependencies:
- types-python-dateutil
- types-requests

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks # Detect common mistake of using single backticks when writing rst
- id: rst-directive-colons # Detect mistake of rst directive not ending with double colon or space before the double colon
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst
- id: text-unicode-replacement-char # Forbid files which have a UTF-8 Unicode replacement character
2 changes: 1 addition & 1 deletion DCO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ By making a contribution to this project, I certify that:
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
this project or the open source license(s) involved.
2 changes: 1 addition & 1 deletion Overpass/OFL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
Expand Down
2 changes: 1 addition & 1 deletion Overpass_Mono/OFL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ sphinx-rtd-theme = "*"
sphinx-tabs = "*"
pytest-cov = "*"
types-pillow = "*"
pre-commit = "*"

[requires]
python_version = "3.11"
231 changes: 221 additions & 10 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import into the Dolphin software.
The right pane is for race result files. Use the "Browse..." button to select
the directory where the race result files will be written by the Dolphin
software. Any race result files that are found will be displayed in the table,
ordered by their timestamp.
ordered by their timestamp.

.. _config_run_tab:

Expand Down

0 comments on commit 1d37c85

Please sign in to comment.