Skip to content

Commit 73eb3c2

Browse files
authored
Merge pull request #152 from alisnwu/codespell
Configure automatic spelling check via codespell within pre-commit
2 parents fae4cd6 + e5a6c38 commit 73eb3c2

10 files changed

+52
-5
lines changed

Diff for: .codespell/ignore_lines.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
;; Please include filenames and explanations for each ignored line.
2+
;; See https://docs.openverse.org/meta/codespell.html for docs.

Diff for: .codespell/ignore_words.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
;; Please include explanations for each ignored word (lowercase).
2+
;; See https://docs.openverse.org/meta/codespell.html for docs.
3+
4+
;; abbreviation for "materials" often used in a journal title
5+
mater
6+
7+
;; alternative use of socioeconomic
8+
socio-economic
9+
10+
;; Frobenius norm used in np.linalg.norm
11+
fro

Diff for: .pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ repos:
4444
name: Prevent Commit to Main Branch
4545
args: ["--branch", "main"]
4646
stages: [pre-commit]
47+
- repo: https://github.com/codespell-project/codespell
48+
rev: v2.3.0
49+
hooks:
50+
- id: codespell
51+
additional_dependencies:
52+
- tomli

Diff for: CHANGELOG.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ v3.2.3
117117

118118
**Added:**
119119

120-
* Compatability with Python 3.12.0rc3, 3.11.
120+
* Compatibility with Python 3.12.0rc3, 3.11.
121121
* CI Coverage.
122122
* New tests for loadData function.
123123
* loadData function now toggleable. Can return either (a) data read from data blocks or (b) header information stored

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ trying to commit again.
134134

135135
Improvements and fixes are always appreciated.
136136

137-
Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.utils/blob/main/CODE_OF_CONDUCT.rst>`_.
137+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.utils/blob/main/CODE_OF_CONDUCT.rst>`_.
138138

139139
Contact
140140
-------

Diff for: news/codespell.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Spelling check via Codespell in pre-commit
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

Diff for: pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5151
[tool.setuptools.dynamic]
5252
dependencies = {file = ["requirements/pip.txt"]}
5353

54+
[tool.codespell]
55+
exclude-file = ".codespell/ignore_lines.txt"
56+
ignore-words = ".codespell/ignore_words.txt"
57+
skip = "*.cif,*.dat"
58+
5459
[tool.black]
5560
line-length = 115
5661
include = '\.pyi?$'

Diff for: src/diffpy/utils/parsers/loaddata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def loadData(filename, minrows=10, headers=False, hdel="=", hignore=None, **kwar
3030
Minimum number of rows in the first data block. All rows must have the same number of floating
3131
point values.
3232
headers: bool
33-
when False (defualt), the function returns a numpy array of the data in the data block.
33+
when False (default), the function returns a numpy array of the data in the data block.
3434
When True, the function instead returns a dictionary of parameters and their corresponding
3535
values parsed from header (information prior the data block). See hdel and hignore for options
3636
to help with parsing header information.

Diff for: src/diffpy/utils/parsers/resample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def resample(r, s, dr):
113113
# spad = numpy.concatenate([s,spad])
114114
# rnew = numpy.arange(0, rpad[-1], dr)
115115
# snew = numpy.zeros_like(rnew)
116-
# Accomodate for the fact that r[0] might not be 0
116+
# Accommodate for the fact that r[0] might not be 0
117117
# u = (rnew-r[0]) / dr0
118118
# for n in range(len(spad)):
119119
# snew += spad[n] * numpy.sinc(u - n)

Diff for: src/diffpy/utils/parsers/serialization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def serialize_data(
5656
include a path element in the database entry (default True). If 'path' is not included in hddata,
5757
extract path from filename.
5858
serial_file
59-
Serial language file to dump dictionary into. If None (defualt), no dumping will occur.
59+
Serial language file to dump dictionary into. If None (default), no dumping will occur.
6060
6161
Returns
6262
-------

0 commit comments

Comments
 (0)