Skip to content

Commit c7ac084

Browse files
Tieqiongsbillinge
andauthored
style: update pre-commit and auto fix (#246)
* update pre-commit with autofix * add news * conflicts to be reverted --------- Co-authored-by: Simon Billinge <[email protected]>
1 parent 0542b86 commit c7ac084

File tree

88 files changed

+6125
-3624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6125
-3624
lines changed

Diff for: .codecov.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
coverage:
22
status:
3-
project: # more options at https://docs.codecov.com/docs/commit-status
3+
project: # more options at https://docs.codecov.com/docs/commit-status
44
default:
55
target: auto # use the coverage from the base commit, fail if coverage is lower
6-
threshold: 0% # allow the coverage to drop by
6+
threshold: 0% # allow the coverage to drop by
77

88
comment:
99
layout: " diff, flags, files"
1010
behavior: default
1111
require_changes: false
12-
require_base: false # [true :: must have a base report to post]
13-
require_head: false # [true :: must have a head report to post]
12+
require_base: false # [true :: must have a base report to post]
13+
require_head: false # [true :: must have a head report to post]
1414
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]

Diff for: .pre-commit-config.yaml

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
default_language_version:
2-
python: python3
2+
python: python3
33
ci:
4-
autofix_commit_msg: |
5-
[pre-commit.ci] auto fixes from pre-commit hooks
6-
autofix_prs: true
7-
autoupdate_branch: 'pre-commit-autoupdate'
8-
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
9-
autoupdate_schedule: monthly
10-
skip: [no-commit-to-branch]
11-
submodules: false
4+
autofix_commit_msg: |
5+
[pre-commit.ci] auto fixes from pre-commit hooks
6+
autofix_prs: true
7+
autoupdate_branch: "pre-commit-autoupdate"
8+
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
9+
autoupdate_schedule: monthly
10+
skip: [no-commit-to-branch]
11+
submodules: false
1212
repos:
1313
- repo: https://github.com/pre-commit/pre-commit-hooks
1414
rev: v4.6.0
@@ -47,6 +47,20 @@ repos:
4747
- repo: https://github.com/codespell-project/codespell
4848
rev: v2.3.0
4949
hooks:
50-
- id: codespell
51-
additional_dependencies:
52-
- tomli
50+
- id: codespell
51+
additional_dependencies:
52+
- tomli
53+
# prettier - multi formatter for .json, .yml, and .md files
54+
- repo: https://github.com/pre-commit/mirrors-prettier
55+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
56+
hooks:
57+
- id: prettier
58+
additional_dependencies:
59+
- "prettier@^3.2.4"
60+
# docformatter - PEP 257 compliant docstring formatter
61+
- repo: https://github.com/s-weigand/docformatter
62+
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
63+
hooks:
64+
- id: docformatter
65+
additional_dependencies: [tomli]
66+
args: [--in-place, --config, ./pyproject.toml]

Diff for: doc/manual/extractEquations.py

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
def loadEquations():
3939
"""Search for equation codes preceded by @EquationMark macro.
40+
4041
Store equation codes in rc['eqns'].
4142
"""
4243
lines = []
@@ -116,6 +117,7 @@ def convertToPNG(texfile):
116117

117118
def getBoundingBox(psfilename):
118119
"""Run ghostscript to obtain effective bounding box of psfilename.
120+
119121
Return a list of bounding box coordinates.
120122
"""
121123
cmd = "gs -dNOPAUSE -dBATCH -q -sDEVICE=bbox %r" % psfilename
@@ -132,6 +134,7 @@ def getBoundingBox(psfilename):
132134

133135
def getPageBoundingBox(psfilename):
134136
"""Obtain bounding box value defined in psfilename.
137+
135138
Return a list of bounding box coordinates.
136139
"""
137140
import re

Diff for: doc/manual/fixHTMLCode.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def eqreplace(mx):
28-
"""helper function to replace equation marks.
28+
"""Helper function to replace equation marks.
2929
3030
mx -- regular expression match object
3131
@@ -41,6 +41,7 @@ def eqreplace(mx):
4141

4242
def replaceEquationMarks(s):
4343
"""Replace equation marks in given string.
44+
4445
Return modified string.
4546
"""
4647
s1 = re.sub(eqmark, eqreplace, s)

0 commit comments

Comments
 (0)