Skip to content

Commit 2b39282

Browse files
authored
Merge pull request #12 from Rasic2/dev/zhouh
chore: enhance pre-commit configuration with additional hooks for rob…
2 parents 63ac066 + 43a1315 commit 2b39282

18 files changed

Lines changed: 95 additions & 40 deletions

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ version-resolver:
3939
- 'security'
4040

4141
exclude-labels:
42-
- 'skip-changelog'
42+
- 'skip-changelog'

.github/workflows/check-pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
steps:
1616
- uses: amannn/action-semantic-pull-request@v6
1717
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-auto-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
// 检查第一个单词或前缀是否匹配关键词
4848
for (const word of words) {
4949
const normalizedWord = word.toLowerCase().replace(/^[\W_]+|[\W_]+$/g, '');
50-
50+
5151
if (keywordMap.hasOwnProperty(normalizedWord)) {
5252
labelsToAdd.add(keywordMap[normalizedWord]);
5353
break; // 找到第一个匹配就停止
@@ -79,4 +79,4 @@ jobs:
7979
labels: labelsArray
8080
});
8181
console.log('New labels added successfully');
82-
}
82+
}

.pre-commit-config.yaml

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,60 @@ repos:
33
rev: v6.0.0 # Use the ref you want to point at
44
hooks:
55
- id: check-added-large-files
6-
# - id: trailing-whitespace
7-
# - id: check-yaml
6+
- id: check-ast
7+
- id: check-builtin-literals
8+
- id: check-case-conflict
9+
- id: check-docstring-first
10+
- id: check-executables-have-shebangs
11+
- id: check-illegal-windows-names
12+
- id: check-json
13+
- id: check-shebang-scripts-are-executable
14+
exclude: |
15+
(?x)^(
16+
gvasp/slurm.submit|
17+
tests/module/gzy.vtst.conTS.submit|
18+
tests/submit.script|
19+
auto_conda.sh|
20+
gvasp/gvasp-bash-completion.sh
21+
)$
22+
- id: pretty-format-json
23+
args: [ --autofix ]
24+
- id: check-merge-conflict
25+
- id: check-symlinks
26+
- id: check-toml
27+
- id: check-vcs-permalinks
28+
- id: check-xml
29+
- id: check-yaml
30+
exclude: |
31+
(?x)^(
32+
conda/meta.yaml
33+
)$
34+
- id: debug-statements
35+
- id: destroyed-symlinks
36+
- id: detect-aws-credentials
37+
args: [ --allow-missing-credentials ]
38+
- id: detect-private-key
39+
- id: double-quote-string-fixer
40+
- id: end-of-file-fixer
41+
- id: file-contents-sorter
42+
- id: fix-byte-order-marker
43+
- id: forbid-new-submodules
44+
- id: forbid-submodules
45+
- id: mixed-line-ending
46+
- id: name-tests-test
47+
args: [ --pytest-test-first ]
48+
exclude: |
49+
(?x)^(
50+
tests/modify_config.py|
51+
tests/add_font.py|
52+
tests/plot_center/dos_plot.py|
53+
tests/utils.py
54+
)$
55+
- id: no-commit-to-branch
56+
- id: requirements-txt-fixer
57+
- id: sort-simple-yaml
58+
- id: trailing-whitespace
59+
- repo: https://github.com/asottile/pyupgrade
60+
rev: v3.20.0
61+
hooks:
62+
- id: pyupgrade

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ python:
2929
install:
3030
- requirements: requirements.txt
3131
# - method: setuptools
32-
# path: .
32+
# path: .

docs/source/conf.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3232
# ones.
3333
extensions = [
34-
'sphinx.ext.autodoc',
35-
'sphinx.ext.viewcode',
36-
'myst_parser',
34+
'sphinx.ext.autodoc',
35+
'sphinx.ext.viewcode',
36+
'myst_parser',
3737
'sphinxcontrib.inkscapeconverter',
3838
'sphinxcontrib.jquery']
3939

4040
myst_enable_extensions = [
41-
"amsmath",
42-
"colon_fence",
43-
"deflist",
44-
"dollarmath",
45-
"fieldlist",
46-
"html_admonition",
47-
"html_image",
48-
"linkify",
49-
"replacements",
50-
"smartquotes",
51-
"strikethrough",
52-
"substitution",
53-
"tasklist",
41+
'amsmath',
42+
'colon_fence',
43+
'deflist',
44+
'dollarmath',
45+
'fieldlist',
46+
'html_admonition',
47+
'html_image',
48+
'linkify',
49+
'replacements',
50+
'smartquotes',
51+
'strikethrough',
52+
'substitution',
53+
'tasklist',
5454
]
5555

5656
# Add any paths that contain templates here, relative to this directory.
@@ -82,4 +82,4 @@
8282
latex_elements = {
8383
'preamble': '\\usepackage[UTF8]{ctex}\n',
8484
'extraclassoptions': 'openany,oneside',
85-
}
85+
}

docs/source/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
development/migration.md
2020
development/sphinx.md
2121
development/codecov.md
22-
development/bug.md
22+
development/bug.md
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
recursive-include gvasp/pot POTCAR *.bindat
1+
recursive-include gvasp/pot POTCAR *.bindat

docs/source/development/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
```bash
66
conda pack -n gvasp -o gvasp.tar.gz
7-
```
7+
```

docs/source/development/mirror.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ The conda tool can modify its original mirrors by modify the :file:`~/.condrc`,
1414
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
1515
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
1616
17-
Pip Mirror
17+
Pip Mirror
1818
-----------
1919

2020
The pip tool can modify its original mirrors by add a :file:`~/.pip/pip.conf`, for example:
2121

2222
.. code-block:: bash
23-
23+
2424
[global]
25-
index-url = https://mirrors.aliyun.com/pypi/simple
25+
index-url = https://mirrors.aliyun.com/pypi/simple

0 commit comments

Comments
 (0)