STY: Configure linters and apply style cleanup#11
Merged
technic960183 merged 10 commits intomainfrom May 5, 2025
Merged
Conversation
🦙 MegaLinter status:
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| jscpd | yes | 7 | no | 1.65s | ||
| ✅ JSON | jsonlint | 1 | 0 | 0 | 0.16s | |
| ✅ JSON | v8r | 1 | 0 | 0 | 2.14s | |
| ✅ MARKDOWN | markdownlint | 1 | 0 | 0 | 0.61s | |
| ✅ MARKDOWN | markdown-link-check | 1 | 0 | 0 | 1.41s | |
| ✅ MARKDOWN | markdown-table-formatter | 1 | 0 | 0 | 0.26s | |
| ✅ PYTHON | bandit | 18 | 0 | 0 | 1.81s | |
| black | 18 | 1 | 0 | 2.79s | ||
| ✅ PYTHON | flake8 | 18 | 0 | 0 | 1.15s | |
| ✅ PYTHON | isort | 18 | 0 | 0 | 0.25s | |
| mypy | 18 | 2 | 0 | 5.79s | ||
| ✅ PYTHON | pylint | 18 | 0 | 0 | 21.53s | |
| ✅ PYTHON | ruff | 18 | 0 | 0 | 0.02s | |
| ✅ SPELL | cspell | 31 | 0 | 0 | 4.25s | |
| ✅ SPELL | lychee | 12 | 0 | 0 | 0.58s | |
| ✅ YAML | v8r | 4 | 0 | 0 | 5.86s | |
| ✅ YAML | yamllint | 4 | 0 | 0 | 0.43s |
See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff
MegaLinter is graciously provided by OX Security
b486e48 to
d49cbba
Compare
Thanks: flake8
Thanks: flake8, ruff
Thanks: mypy, pyright
Thanks: isort, ruff Also make the relative import to absolute import for unittest files. So the unittest loader can load them correctly. - `from .test_fof import generate_celestial_grid` + `from tests.test_fof import generate_celestial_grid`
Thanks: ruff, pylint
Thanks: black I have not decided yet if I want to use `black` style for the whole project.
Thanks: cspell
Thanks: cspell Thanks the `megalinter` team to make `cspell` able to check the filename. This lead me to the discovery that I forgot to rename this rst file when I renamed the package.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Configure and apply code style checks using MegaLinter (initial setup in PR #10). This PR refines multiple linter configurations and updates the codebase to comply with their rules.
Change of Linter Configuration
.mega-linter.yml,.isort.cfg,.cspell.json, etc.RSTrelated linters, because they can't work with directives fromSphinx.pyright, because I fail to install dependency to its virtual environment and it won't work well.prettier, because they don't give effective message in non-fix mode.git_diff,gitleak, andtrivy. Others are redundant or are not useful for this project.jscpdandmypy.Change of the Codebase
flake8)flake8,ruff)mypy,pyright)isort,ruff)ruff,pylint)black)cspell)docs/source/dev/pycorrelator.rst->docs/source/dev/spherimatch.rst. (cspell) What a great catch!Note