Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Media

- Linters enhancements
- Python Linting: Added more file type supports for various linters. Full description [here](https://github.com/oxsecurity/megalinter/pull/6214)

- Fixes

Expand Down
25 changes: 24 additions & 1 deletion megalinter/descriptors/python.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ processing_order: -9
linters:
# PYLINT
- linter_name: pylint
file_extensions:
- ".py"
- ".pyi"
linter_text: |
**Pylint** is a comprehensive static code analyzer for Python that goes beyond simple syntax checking. It analyzes your code without actually running it, checking for errors, enforcing coding standards, detecting code smells, and suggesting refactoring opportunities.

Expand Down Expand Up @@ -85,6 +88,10 @@ linters:
url: https://code.visualstudio.com/docs/python/linting#_pylint
# BLACK
- linter_name: black
file_extensions:
- ".py"
- ".pyi"
- ".ipynb"
linter_text: |
**Black** is "the uncompromising code formatter" for Python that automatically formats your code to be consistent and PEP 8 compliant. By using Black, you agree to cede control over minutiae of hand-formatting in return for speed, determinism, and freedom from formatting debates.

Expand Down Expand Up @@ -153,7 +160,7 @@ linters:
# renovate: datasource=pypi depName=black
ARG PIP_BLACK_VERSION=25.9.0
pip:
- black==${PIP_BLACK_VERSION}
- black[jupyter]==${PIP_BLACK_VERSION}
ide:
emacs:
- name: blacken
Expand Down Expand Up @@ -218,6 +225,11 @@ linters:
url: https://code.visualstudio.com/docs/python/linting#_flake8
# ISORT
- linter_name: isort
file_extensions:
- ".py"
- ".pyi"
- ".pyx"
- ".pxd"
linter_text: |
**isort** is the definitive Python import sorting tool that automatically organizes and standardizes import statements according to configurable rules. It serves as an essential companion to code formatters for maintaining clean, professional Python codebases.

Expand Down Expand Up @@ -286,6 +298,10 @@ linters:
- linter_name: bandit
name: PYTHON_BANDIT
can_output_sarif: true
file_extensions:
- ".py"
- ".pyi"
- ".ipynb"
descriptor_flavors:
- python
- security
Expand Down Expand Up @@ -366,6 +382,10 @@ linters:
# MYPY
- linter_name: mypy
name: PYTHON_MYPY
file_extensions:
- ".py"
- ".pyi"
- ".ipynb"
linter_text: |
**MyPy** is Python's premier static type checker that brings optional static typing to Python through gradual typing. It analyzes type annotations and infers types to catch bugs before runtime, bridging the gap between Python's dynamic nature and static analysis benefits.

Expand Down Expand Up @@ -459,6 +479,9 @@ linters:
- class: PyrightLinter
linter_name: pyright
name: PYTHON_PYRIGHT
file_extensions:
- ".py"
- ".pyi"
linter_text: |
**Pyright** is Microsoft's high-performance static type checker for Python that provides fast, accurate type analysis. It serves as a powerful alternative to MyPy with focus on speed and developer experience.

Expand Down
Loading