Skip to content

Commit 58ccd6e

Browse files
authored
Added pre-commit (django#18)
* Added pre-commit and drop lint workflow in github actions. We'll now use pre-commit CI to run these checks.
1 parent da1f18a commit 58ccd6e

File tree

8 files changed

+33
-57
lines changed

8 files changed

+33
-57
lines changed

.github/workflows/benchmark.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
push:
66
branches:
77
- "main"
8-
8+
99
jobs:
10-
10+
1111
run_benchmarks:
1212
runs-on: ubuntu-latest
1313
steps:
@@ -20,6 +20,6 @@ jobs:
2020
- name: Install Requirements
2121
run: pip install -r requirements.txt
2222
- name: Run Benchmarks
23-
run: |-
23+
run: |-
2424
asv machine --yes
2525
asv run

.github/workflows/lint.yml

-48
This file was deleted.

.pre-commit-config.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.2.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-json
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-toml
11+
- id: end-of-file-fixer
12+
- id: trailing-whitespace
13+
- repo: https://github.com/psf/black
14+
rev: 22.3.0
15+
hooks:
16+
- id: black
17+
- repo: https://github.com/pycqa/isort
18+
rev: 5.10.1
19+
hooks:
20+
- id: isort
21+
- repo: https://github.com/PyCQA/flake8
22+
rev: 4.0.1
23+
hooks:
24+
- id: flake8

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1717
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1818
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1919
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
Benchmarks for Django using [asv](https://asv.readthedocs.io/en/stable/)
55

6-
Currently, only a small sample of Djangobench benchmarks have been migrated to the asv format.
6+
Currently, only a small sample of Djangobench benchmarks have been migrated to the asv format.
77

8-
Running the benchmarks should be as "simple" as cloning the repo, installing the requirements
8+
Running the benchmarks should be as "simple" as cloning the repo, installing the requirements
99
into a new virtual env, and running `asv run` from the command prompt.
1010

11-
CPU isolation is also imporant -- use the --cpu-affinity flag for this.
11+
CPU isolation is also imporant -- use the --cpu-affinity flag for this.

benchmarks/fixtures/initial_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1499,4 +1499,4 @@
14991499
"author": 100
15001500
}
15011501
}
1502-
]
1502+
]

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
asv
22
virtualenv
3+
pre-commit

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ combine_as_imports = true
88
include_trailing_comma = true
99
line_length = 79
1010
multi_line_output = 5
11-

0 commit comments

Comments
 (0)