Skip to content

Commit

Permalink
add pre-commit and install a bunch of hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Böck committed Jan 6, 2022
1 parent a71d6ec commit aa8b8c9
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ coverage:
status:
patch: false

comment: off
comment: off
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
ignore = E203,W503,Q000
max-line-length = 80
per-file-ignores =
*/__init__.py: F401
tests/***.py: F405
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks: # for a list of hooks see https://github.com/pre-commit/pre-commit-hooks
- id: check-added-large-files
args: ['--maxkb=100']
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
- id: mixed-line-ending
- id: no-commit-to-branch
- id: pretty-format-json
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion bin/KeyRecognition
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main():
Filip Korzeniowski and Gerhard Widmer,
"Genre-Agnostic Key Classification with Convolutional Neural Networks",
In Proceedings of the 19th International Society for Music Information
In Proceedings of the 19th International Society for Music Information
Retrieval Conference (ISMIR), Paris, France, 2018.
This program can be run in 'single' file mode to process a single audio
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# fake requirements for readthedocs
cython
numpydoc
mido
numpydoc
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy>=1.13.4
scipy>=0.16
cython>=0.25
mido>=1.2.6
numpy>=1.13.4
scipy>=0.16
2 changes: 1 addition & 1 deletion tests/data/annotations/dummy.chords
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.1 1.0 A:min
1.0 2.0 F:maj
2.0 3.0 C:maj
3.0 4.0 G:maj
3.0 4.0 G:maj
2 changes: 1 addition & 1 deletion tests/data/annotations/dummy.key
Original file line number Diff line number Diff line change
@@ -1 +1 @@
F# minor
F# minor
2 changes: 1 addition & 1 deletion tests/data/detections/dummy.chords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
2.2 2.9 C:maj/3
2.9 3.5 G:maj7/7
3.5 4.1 G:aug
4.1 4.3 N
4.1 4.3 N
2 changes: 1 addition & 1 deletion tests/data/detections/dummy.key.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a maj
a maj
2 changes: 1 addition & 1 deletion tests/data/detections/sample.key_recognition.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Ab major
Ab major
2 changes: 1 addition & 1 deletion tests/data/detections/sample2.key_recognition.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A minor
A minor

0 comments on commit aa8b8c9

Please sign in to comment.