Skip to content

Commit a376a66

Browse files
committed
add code spell and pygrep-hooks
1 parent 5053953 commit a376a66

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed

.github/workflows/conda-package-cf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ jobs:
301301
- name: Report content of test environment
302302
shell: cmd /C CALL {0}
303303
run: |
304-
echo "Value of CONDA enviroment variable was: " %CONDA%
305-
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
304+
echo "Value of CONDA environment variable was: " %CONDA%
305+
echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX%
306306
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
307307
308308
- name: Run tests

.github/workflows/conda-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ jobs:
301301
- name: Report content of test environment
302302
shell: cmd /C CALL {0}
303303
run: |
304-
echo "Value of CONDA enviroment variable was: " %CONDA%
305-
echo "Value of CONDA_PREFIX enviroment variable was: " %CONDA_PREFIX%
304+
echo "Value of CONDA environment variable was: " %CONDA%
305+
echo "Value of CONDA_PREFIX environment variable was: " %CONDA_PREFIX%
306306
conda info && conda list -n ${{ env.TEST_ENV_NAME }}
307307
- name: Run tests
308308
shell: cmd /C CALL {0}

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ jobs:
2020
with:
2121
python-version: '3.12'
2222

23-
- uses: BSFishy/pip-action@v1
23+
- name: Set up pip packages
24+
uses: BSFishy/pip-action@v1
2425
with:
2526
packages: |
27+
codespell
2628
pylint
2729
28-
- name: Version of clang-format
30+
- name: Set up clang-format
2931
run: |
32+
sudo apt-get install -y clang-format-14
33+
sudo unlink /usr/bin/clang-format
34+
sudo ln -s /usr/bin/clang-format-14 /usr/bin/clang-format
3035
clang-format --version
3136
3237
- name: Run pre-commit checks

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@ repos:
1515
- id: mixed-line-ending
1616
- id: trailing-whitespace
1717

18+
- repo: https://github.com/pre-commit/pygrep-hooks
19+
rev: v1.10.0
20+
hooks:
21+
- id: python-check-blanket-noqa
22+
- id: python-check-blanket-type-ignore
23+
- id: python-check-mock-methods
24+
- id: python-no-eval
25+
- id: python-no-log-warn
26+
- id: python-use-type-annotations
27+
- id: rst-backticks
28+
- id: rst-directive-colons
29+
- id: rst-inline-touching-normal
30+
- id: text-unicode-replacement-char
31+
32+
- repo: https://github.com/codespell-project/codespell
33+
rev: v2.4.1
34+
hooks:
35+
- id: codespell
36+
args: ["-L", "nd"] # ignore "nd" used for n-dimensional
37+
additional_dependencies:
38+
- tomli
39+
1840
- repo: https://github.com/psf/black
1941
rev: 25.1.0
2042
hooks:

mkl_fft/_scipy_fft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from ._float_utils import _supported_array_or_not_implemented
4444

4545
__doc__ = """
46-
This module implements interfaces mimicing `scipy.fft` module.
46+
This module implements interfaces mimicking `scipy.fft` module.
4747
4848
It also provides DftiBackend class which can be used to set mkl_fft to be used
4949
via `scipy.fft` namespace.

mkl_fft/src/mklfft.c.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ compute_strides_and_distances(
363363
break;
364364
default:
365365
/* we must have C- or F- contiguous layout */
366-
/* TODO: enhance the test to acommodate equal size slices along all axis of a contiguous array, *
366+
/* TODO: enhance the test to accommodate equal size slices along all axis of a contiguous array, *
367367
* for example x = contig_r3_arr[::4, ::4, ::4] */
368368
{
369369
int any_contig = (PyArray_ISONESEGMENT(x)) ? 1 : 0;

mkl_fft/tests/third_party/numpy/test_fft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_fft_inplace_out(self, axis):
175175
else:
176176
assert_array_equal(y3[:, :5], y[:, :5])
177177
assert_array_equal(y3[:, 15:], y[:, 15:])
178-
# In-place with n > nin; rest should be unchanged.
178+
# In-place with n > n_in; rest should be unchanged.
179179
y4 = y.copy()
180180
y4_sel = y4[:10] if axis == 0 else y4[:, :10]
181181
out4 = y4[:15] if axis == 0 else y4[:, :15]

0 commit comments

Comments
 (0)