-
Notifications
You must be signed in to change notification settings - Fork 59
feat: Plug in Linter framework and lint test framework #795
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
base: main
Are you sure you want to change the base?
Conversation
… linters. Includes a linter testing framework to ensure linters behave as expected. Adds linter severity levels and categories. Adds configuration options to modify and customize what lints are used. Adds docs covering how to create custom linters, how to configure them, patterns used and how to use the linter testing framework. Adds a linter testing example and comprehensive unit tests.
… script to show them in action
…, performance tests, compatibility with existing features, error handling tests
…prevent Pytest getting confused. Updates docs and examples appropriately. Enables two disabled tests of the CLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a pluggable lint framework with severity levels and categories, plus a dedicated testing framework for linters. It updates the CLI, configuration, and documentation to support custom linters and allows filtering by severity or category. Example linters and usage demos are also included.
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/test_lint_testing_framework.py | Add unit tests for lint-testing helpers (validate_linter , create_test_wdl , assertions) |
tests/test_lint_severity.py | Add tests for LintSeverity , LintCategory , and base Linter attributes |
tests/test_lint_exit_codes_simple.py | Add CLI exit-code tests for --strict and --exit-on-lint-severity |
tests/test_lint_execution.py | Add execution tests covering error handling and linter filtering |
tests/test_lint_error_handling.py | Add tests for graceful handling of linter exceptions |
tests/test_lint_discovery.py | Add tests for dynamic discovery and filtering of linter plugins |
tests/test_lint_config.py | Add tests for config file and environment variable overrides |
tests/test_lint_cli_updates.py | Add tests for --list-linters , category filtering, and exit severity behavior |
tests/test_lint_cli.py | Add tests for CLI config precedence between env and config files |
tests/test_integration_performance.py | Add performance benchmark tests for linting scalability and memory |
tests/test_integration_linting.py | Add end-to-end integration tests for discovery, execution, and CLI flags |
tests/test_integration_edge_cases.py | Add edge-case tests for malformed, minimal, and deeply nested WDL files |
tests/test_example_linters.py | Add unit tests validating the provided example linters package |
examples/linter_testing_example.py | Provide example script demonstrating the lint testing framework |
examples/example_linters_demo.py | Provide a CLI-driven demo of example linters |
examples/example_linters/style_linters.py | Add sample style-focused lint rules |
examples/example_linters/security_linters.py | Add sample security-focused lint rules |
examples/example_linters/performance_linters.py | Add sample performance-focused lint rules |
examples/example_linters/best_practices_linters.py | Add sample best-practice-focused lint rules |
examples/example_linters/init.py | Initialize the example linters package and define collections |
@markjschreiber Great stuff, thank you! #667 It looks like there are some remaining issues in the integration tests we have for |
skips test if test wdl not found Co-authored-by: Copilot <[email protected]>
Thanks for the review @mlin, good catch, the |
…slower build systems. Collect lints as 4-tuples for backwards compatibility and updates tests to use these. Updates lint module discovery to work with older versions (pre 3.10) of Python.
I have setup my dev environment to be more similar to the CICD environment and adjusted my code to ensure the full |
Pull Request Test Coverage Report for Build 16452461200Details
💛 - Coveralls |
Motivation
...
I wanted to create a pluggable mechanism to allow the creation and extension of Lint tests without the need to overload the core
Lint.py
. I wanted to be able to categorize lints by severity and lint type. I wanted to be able to create simple tests for custom Linters to ensure they find issues as expected without false positives.Approach
...
Adds a pluggable lint framework to allow the creation of custom linters. Includes a linter testing framework to ensure linters behave as expected. Adds linter severity levels and categories. Adds configuration options to modify and customize what lints are used. Adds docs covering how to create custom linters, how to configure them, patterns used and how to use the linter testing framework. Adds a linter testing example and comprehensive unit tests. Adds an example lint extension package.
Checklist
make pretty
to reformat the code withruff format
make check
to statically check the code usingruff check
andmypy