Skip to content

Commit fb8db49

Browse files
Configure automatic spelling check via codespell within pre-commit (#121)
* configure codespell at pyproject.toml and pre-commit * Add news * Fix ignore wording * Do not use full sentences in ignore words * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8bc03e0 commit fb8db49

File tree

10 files changed

+54
-7
lines changed

10 files changed

+54
-7
lines changed

.codespell/ignore_lines.txt

Lines changed: 2 additions & 0 deletions
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.

.codespell/ignore_words.txt

Lines changed: 11 additions & 0 deletions
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

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
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

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Release Notes
99

1010
**Fixed:**
1111

12-
* Updated REAMDE instructions for pip and conda-forge install
13-
* Updated REAMDE instructions to check for successful installation
12+
* Updated README instructions for pip and conda-forge install
13+
* Updated README instructions to check for successful installation
1414

1515

1616
0.1.2

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ trying to commit again.
127127

128128
Improvements and fixes are always appreciated.
129129

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

132132
Contact
133133
-------

doc/source/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _quick_start:
22

3-
Tutorial (To be addded)
3+
Tutorial (To be added)
44
#################
55

66
Welcome! This will be a quick tutorial to accquaint users with `snmf`.
@@ -18,5 +18,5 @@ Add extra tutorials here
1818
Bug Reports
1919
===========
2020

21-
Please enjoy using our software! If you come accross any bugs in the
21+
Please enjoy using our software! If you come across any bugs in the
2222
application, please report them to [email protected].

news/codespell.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Add spelling check pre-commit via Codespell
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>

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5454
[tool.setuptools.dynamic]
5555
dependencies = {file = ["requirements/pip.txt"]}
5656

57+
[tool.codespell]
58+
exclude-file = ".codespell/ignore_lines.txt"
59+
ignore-words = ".codespell/ignore_words.txt"
60+
skip = "*.cif"
61+
5762
[tool.black]
5863
line-length = 115
5964
include = '\.pyi?$'

src/diffpy/snmf/polynomials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def rooth(linear_coefficient, constant_term):
88
99
Parameters
1010
----------
11-
linear_coefficient: nd array like of floats
11+
linear_coefficient: ndarray like of floats
1212
The matrix coefficient of the linear term
1313
constant_term: 0d array like, 1d array like of floats or scalar
1414
The constant scalar term of the problem

src/diffpy/snmf/subroutines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def update_weights_matrix(
362362
The matrx containing the stretching factors of the calculated component signals. Has dimensions K x M
363363
where K is the number of component signals and M is the number of XRD/PDF patterns.
364364
365-
component_matrix: 2d array lik
365+
component_matrix: 2d array like
366366
The matrix containing the unstretched calculated component signals. Has dimensions N x K where N is the
367367
length of the signals and K is the number of component signals.
368368

0 commit comments

Comments
 (0)