-
Notifications
You must be signed in to change notification settings - Fork 21
add pre-commit hooks #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add pre-commit hooks #142
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[flake8] | ||
extend-ignore = | ||
# whitespace before ':' (currently conflicts with black formatting): | ||
E203, | ||
# line too long (in docstrings): | ||
E501, | ||
# ‘from module import *’ used; unable to detect undefined names: | ||
F403, | ||
# doc line too long (105 > 80 characters): | ||
W505, | ||
# missing docstring in public module: | ||
D100, | ||
# missing docstring in public class: | ||
D101, | ||
# missing docstring in public method: | ||
D102, | ||
# missing docstring in public function: | ||
D103, | ||
# missing docstring in public package: | ||
D104, | ||
# missing docstring in magic method: | ||
D105, | ||
# missing docstring in __init__: | ||
D107, | ||
# no blank lines allowed after function docstring: | ||
D202, | ||
# 1 blank line required between summary line and description: | ||
D205, | ||
# first line should end with a period: | ||
D400, | ||
# first line should be in imperative mood: | ||
D401, | ||
# first line should not be the function's "signature": | ||
D402, | ||
# first word of the first line should be properly capitalized | ||
D403, | ||
|
||
per-file-ignores = | ||
mkl_fft/__init__.py: E402, F401 | ||
mkl_fft/interfaces/__init__.py: F401 | ||
mkl_fft/interfaces/scipy_fft.py: F401 | ||
mkl_fft/interfaces/numpy_fft.py: F401 | ||
|
||
exclude = _vendored/conv_template.py | ||
|
||
filename = *.py, *.pyx, *.pxi, *.pxd | ||
max_line_length = 80 | ||
max-doc-length = 80 | ||
show-source = True | ||
|
||
# Print detailed statistic if any issue detected | ||
count = True | ||
statistics = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
|
||
# Add pre-commit hooks | ||
2e1b33fcf6b7f0c7c9d7d5d7f55d2d0ba35f393a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4.2.2 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- uses: BSFishy/pip-action@v1 | ||
with: | ||
packages: | | ||
pylint | ||
|
||
- name: Version of clang-format | ||
run: | | ||
clang-format --version | ||
|
||
- name: Run pre-commit checks | ||
uses: pre-commit/action@v3.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 25.1.0 | ||
hooks: | ||
- id: black | ||
exclude: "_vendored/conv_template.py" | ||
|
||
- repo: https://github.com/pocc/pre-commit-hooks | ||
rev: v1.3.5 | ||
hooks: | ||
- id: clang-format | ||
args: ["-i"] | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.1.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--config=.flake8"] | ||
additional_dependencies: | ||
- flake8-docstrings==1.7.0 | ||
- flake8-bugbear==24.4.26 | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 6.0.1 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
- id: isort | ||
name: isort (cython) | ||
types: [cython] | ||
- id: isort | ||
name: isort (pyi) | ||
types: [pyi] | ||
|
||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
rev: v2.14.0 | ||
hooks: | ||
- id: pretty-format-toml | ||
args: [--autofix] | ||
|
||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint | ||
entry: pylint | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
args: | ||
[ | ||
"-rn", # Only display messages | ||
"-sn", # Don't display the score | ||
"--errors-only", | ||
"--disable=import-error", | ||
] | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 3.0.0 | ||
hooks: | ||
- id: shellcheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Security Policy | ||
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. | ||
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. | ||
|
||
## Reporting a Vulnerability | ||
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). | ||
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
#!/bin/bash -x | ||
|
||
if [ `uname` == Darwin ]; then | ||
if [ "$(uname)" == Darwin ]; then | ||
export MACOSX_DEPLOYMENT_TARGET=10.9 | ||
fi | ||
|
||
export MKLROOT=$PREFIX | ||
export CFLAGS="-I$PREFIX/include $CFLAGS" | ||
$PYTHON -m pip install --no-build-isolation --no-deps . | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
#!/bin/bash -x | ||
|
||
if [ `uname` == Darwin ]; then | ||
if [ "$(uname)" == Darwin ]; then | ||
export MACOSX_DEPLOYMENT_TARGET=10.9 | ||
fi | ||
|
||
export MKLROOT=$PREFIX | ||
export CFLAGS="-I$PREFIX/include $CFLAGS" | ||
$PYTHON -m pip install --no-build-isolation --no-deps . | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.