Skip to content

Commit 8c93267

Browse files
authored
Update iSort to use Black style (#267)
* Add Black profile for isort * Remove clang-format * Restore clang-format * Fix yaml spacing * Normalize spacing * Normalize config indentation * Update line limit in clang-format to 80 chars * Update workflows to run on every PR
1 parent 1f7f694 commit 8c93267

File tree

5 files changed

+27
-33
lines changed

5 files changed

+27
-33
lines changed

Diff for: .clang-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
BasedOnStyle: Google
33

44
IndentWidth: 2
5+
ColumnLimit: 80
56
ContinuationIndentWidth: 4
67
UseTab: Never
78
MaxEmptyLinesToKeep: 2
@@ -34,4 +35,4 @@ BinPackArguments: true
3435
BinPackParameters: true
3536
ConstructorInitializerAllOnOneLineOrOnePerLine: false
3637

37-
IndentCaseLabels: true
38+
IndentCaseLabels: true

Diff for: .github/workflows/codeql.yml

-6
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@
2727
name: "CodeQL"
2828

2929
on:
30-
push:
31-
branches: [ 'main' ]
3230
pull_request:
33-
# The branches below must be a subset of the branches above
34-
branches: [ 'main' ]
35-
schedule:
36-
- cron: '0 1 * * 1-6'
3731

3832
jobs:
3933
analyze:

Diff for: .github/workflows/pre-commit.yml

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ name: pre-commit
2828

2929
on:
3030
pull_request:
31-
push:
32-
branches: [main]
3331

3432
jobs:
3533
pre-commit:

Diff for: .pre-commit-config.yaml

+24-24
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,41 @@ repos:
3333
- repo: https://github.com/psf/black
3434
rev: 23.1.0
3535
hooks:
36-
- id: black
37-
types_or: [python, cython]
36+
- id: black
37+
types_or: [python, cython]
3838
- repo: https://github.com/PyCQA/flake8
3939
rev: 5.0.4
4040
hooks:
41-
- id: flake8
42-
args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501]
43-
types_or: [python, cython]
41+
- id: flake8
42+
args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501]
43+
types_or: [python, cython]
4444
- repo: https://github.com/pre-commit/mirrors-clang-format
4545
rev: v16.0.5
4646
hooks:
47-
- id: clang-format
48-
types_or: [c, c++, cuda, proto, textproto, java]
49-
args: ["-fallback-style=none", "-style=file", "-i"]
47+
- id: clang-format
48+
types_or: [c, c++, cuda, proto, textproto, java]
49+
args: ["-fallback-style=none", "-style=file", "-i"]
5050
- repo: https://github.com/codespell-project/codespell
5151
rev: v2.2.4
5252
hooks:
53-
- id: codespell
54-
additional_dependencies: [tomli]
55-
args: ["--toml", "pyproject.toml"]
56-
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
53+
- id: codespell
54+
additional_dependencies: [tomli]
55+
args: ["--toml", "pyproject.toml"]
56+
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
5757
# More details about these pre-commit hooks here:
5858
# https://pre-commit.com/hooks.html
5959
- repo: https://github.com/pre-commit/pre-commit-hooks
6060
rev: v4.4.0
6161
hooks:
62-
- id: check-case-conflict
63-
- id: check-executables-have-shebangs
64-
- id: check-merge-conflict
65-
- id: check-json
66-
- id: check-toml
67-
- id: check-yaml
68-
- id: check-shebang-scripts-are-executable
69-
- id: end-of-file-fixer
70-
types_or: [c, c++, cuda, proto, textproto, java, python]
71-
- id: mixed-line-ending
72-
- id: requirements-txt-fixer
73-
- id: trailing-whitespace
62+
- id: check-case-conflict
63+
- id: check-executables-have-shebangs
64+
- id: check-merge-conflict
65+
- id: check-json
66+
- id: check-toml
67+
- id: check-yaml
68+
- id: check-shebang-scripts-are-executable
69+
- id: end-of-file-fixer
70+
types_or: [c, c++, cuda, proto, textproto, java, python]
71+
- id: mixed-line-ending
72+
- id: requirements-txt-fixer
73+
- id: trailing-whitespace

Diff for: pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ builtin = "clear"
3636
quiet-level = 3
3737

3838
[tool.isort]
39+
profile = "black"
3940
use_parentheses = true
4041
multi_line_output = 3
4142
include_trailing_comma = true

0 commit comments

Comments
 (0)