Skip to content

Commit c69f5ab

Browse files
authored
Update pre-commit config (#216)
Bye nbqa
1 parent d037b45 commit c69f5ab

File tree

4 files changed

+30
-71
lines changed

4 files changed

+30
-71
lines changed

.pre-commit-config.yaml

+25-66
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,40 @@ default_stages:
66
- push
77
minimum_pre_commit_version: 2.16.0
88
repos:
9-
- repo: https://github.com/psf/black
10-
rev: 24.1.1
11-
hooks:
12-
- id: black
13-
- repo: https://github.com/nbQA-dev/nbQA
14-
rev: 1.7.1
15-
hooks:
16-
- id: nbqa-pyupgrade
17-
args: [--py38-plus]
18-
- id: nbqa-black
19-
- id: nbqa-isort
20-
- id: nbqa-ruff
21-
args: [--fix]
22-
- id: nbqa
23-
entry: nbqa blacken-docs
24-
name: nbqa-blacken-docs
25-
alias: nbqa-blacken-docs
26-
additional_dependencies: [blacken-docs]
27-
args: [--nbqa-md]
28-
- id: nbqa
29-
entry: nbqa mdformat
30-
name: nbqa-mdformat
31-
alias: nbqa-mdformat
32-
additional_dependencies:
33-
[
34-
mdformat,
35-
mdformat-black,
36-
mdformat-frontmatter,
37-
mdformat-web,
38-
mdformat-myst,
39-
]
40-
args: [--nbqa-md]
419
- repo: https://github.com/pre-commit/mirrors-prettier
42-
rev: v4.0.0-alpha.8
10+
rev: v3.1.0
4311
hooks:
4412
- id: prettier
45-
- repo: https://github.com/asottile/blacken-docs
46-
rev: 1.16.0
47-
hooks:
48-
- id: blacken-docs
49-
- repo: https://github.com/PyCQA/isort
50-
rev: 5.13.2
51-
hooks:
52-
- id: isort
53-
- repo: https://github.com/asottile/yesqa
54-
rev: v1.5.0
55-
hooks:
56-
- id: yesqa
57-
additional_dependencies:
58-
- flake8-tidy-imports
59-
- flake8-docstrings
60-
- flake8-rst-docstrings
61-
- flake8-comprehensions
62-
- flake8-bugbear
63-
- flake8-blind-except
13+
# Newer versions of node don't work on systems that have an older version of GLIBC
14+
# (in particular Ubuntu 18.04 and Centos 7)
15+
# EOL of Centos 7 is in 2024-06, we can probably get rid of this then.
16+
# See https://github.com/scverse/cookiecutter-scverse/issues/143 and
17+
# https://github.com/jupyterlab/jupyterlab/issues/12675
18+
language_version: "17.9.1"
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
rev: v0.1.11
21+
hooks:
22+
- id: ruff
23+
args: [--fix, --exit-non-zero-on-fix]
24+
types_or: [python, pyi, jupyter]
25+
- id: ruff-format
26+
types_or: [python, pyi, jupyter]
6427
- repo: https://github.com/pre-commit/pre-commit-hooks
6528
rev: v4.5.0
6629
hooks:
6730
- id: detect-private-key
6831
- id: check-ast
32+
- id: end-of-file-fixer
6933
- id: mixed-line-ending
7034
args: [--fix=lf]
7135
- id: trailing-whitespace
7236
- id: check-case-conflict
73-
- repo: https://github.com/PyCQA/autoflake
74-
rev: v2.2.1
75-
hooks:
76-
- id: autoflake
77-
args:
78-
- --in-place
79-
- --remove-all-unused-imports
80-
- --remove-unused-variable
81-
- --ignore-init-module-imports
82-
- repo: https://github.com/asottile/pyupgrade
83-
rev: v3.15.0
84-
hooks:
85-
- id: pyupgrade
86-
args: [--py3-plus, --py38-plus, --keep-runtime-typing]
37+
- repo: local
38+
hooks:
39+
- id: forbid-to-commit
40+
name: Don't commit rej files
41+
entry: |
42+
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
43+
Fix the merge conflicts manually and remove the .rej files.
44+
language: fail
45+
files: '.*\.rej$'

atac/peakvi_in_R.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1937,4 +1937,4 @@
19371937
},
19381938
"nbformat": 4,
19391939
"nbformat_minor": 4
1940-
}
1940+
}

figures/minification.svg

+1-1
Loading

scrna/scVI_DE_worm.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@
560560
"outputs": [],
561561
"source": [
562562
"adata = adata[:, adata.var[\"highly_variable\"]] # focus on selected genes\n",
563-
"adata.layers[\"counts\"] = (\n",
564-
" adata.X.copy().tocsr()\n",
565-
") # converts to CSR format, preserve counts\n",
563+
"adata.layers[\n",
564+
" \"counts\"\n",
565+
"] = adata.X.copy().tocsr() # converts to CSR format, preserve counts\n",
566566
"\n",
567567
"scvi.model.SCVI.setup_anndata(\n",
568568
" adata, layer=\"counts\", batch_key=\"batch\"\n",

0 commit comments

Comments
 (0)