Skip to content
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

Add ruff linting and pre-commit hooks #3

Merged
merged 3 commits into from
May 31, 2024
Merged

Add ruff linting and pre-commit hooks #3

merged 3 commits into from
May 31, 2024

Conversation

akshaysubr
Copy link
Collaborator

Updating linting from flake8 and isort to ruff. This also adds flake8-bandit rules for automatic security testing.

Also fixed some security failures and added fine grained exceptions for the rest. Everything passes now:

❯ make lint
python tests/_license/header_check.py
License check config:
{
    "copyright_file": "header.txt",
    "dir": "../../",
    "exclude-dir": [
        "../../build/",
        "../../docs/",
        "../../earth2grid/third_party",
        "."
    ],
    "include-ext": [
        ".py"
    ]
}
Success: File headers of 16 files look good!
pre-commit run --all-files
[INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
CRLF end-lines checker...................................................Passed
CRLF end-lines remover...................................................Passed
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check for merge conflicts................................................Passed
Check Yaml...............................................................Passed
black....................................................................Passed
mypy.....................................................................Passed
ruff.....................................................................Passed

@akshaysubr akshaysubr requested a review from nbren12 May 31, 2024 20:31
@nbren12 nbren12 merged commit 9661ddb into main May 31, 2024
0 of 8 checks passed
@nbren12 nbren12 deleted the ruff-linting branch May 31, 2024 21:04
@nbren12 nbren12 mentioned this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants