forked from jupyterhub/mybinder.org-deploy
-
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.
ci: add .pre-commit-config.yaml and .flake8 config
- Loading branch information
1 parent
330dd64
commit 356dfa2
Showing
2 changed files
with
89 additions
and
0 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,15 @@ | ||
# flake8 is a Python linting tool run by pre-commit as declared by our | ||
# pre-commit-config.yaml file. | ||
# | ||
# This configuration is compatible with the autoformatter tool black, and | ||
# further relaxed to not bug us with too small details. | ||
# | ||
# flake8 configuration reference: | ||
# https://flake8.pycqa.org/en/latest/user/configuration.html | ||
# | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = C, E, W | ||
|
||
# Adjustments to linting | ||
builtins = c |
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,74 @@ | ||
# pre-commit is a tool to perform a predefined set of tasks manually and/or | ||
# automatically before git commits are made. | ||
# | ||
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level | ||
# | ||
# Common tasks | ||
# | ||
# - Run on all files: pre-commit run --all-files | ||
# - Register git hooks: pre-commit install --install-hooks | ||
# | ||
repos: | ||
# Autoformat: Python code, syntax patterns are modernized | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.32.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py37-plus | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
args: | ||
# --target-version should be all supported versions | ||
- --target-version=py37 | ||
- --target-version=py38 | ||
- --target-version=py39 | ||
- --target-version=py310 | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: | ||
- --profile=black | ||
|
||
# Autoformat: js, html, markdown, yaml, json | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.6.2 | ||
hooks: | ||
- id: prettier | ||
exclude_types: | ||
# These are excluded initially as pre-commit was added but can | ||
# absolutely be enabled later. If so, we should consider having a | ||
# separate run of pre-commit where we configure a line spacing of 4 | ||
# for these file formats. | ||
- html | ||
- javascript | ||
- css | ||
|
||
# Misc autoformatting and linting | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.2.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
exclude_types: [svg, css, json] | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: requirements-txt-fixer | ||
# These files have requirements.in files associated with them, and are | ||
# generated by pip-compile. | ||
# | ||
exclude: > | ||
images/minesweeper/requirements.txt| | ||
images/federation-redirect/requirements.txt | ||
# Lint: Python code | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: "4.0.1" | ||
hooks: | ||
- id: flake8 |