Add skill for adding custom Pylint guidelines - #16322
Open
JennyPng wants to merge 4 commits into
Open
Conversation
When a new rule is potentially ambiguous, the implementing guidelines now include a step to document it in code_examples.md with violation and compliant code snippets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new agent skill (add-pylint-guidelines) intended to guide contributors through implementing and testing custom rules in the azure-pylint-guidelines-checker pylint plugin.
Changes:
- Adds a new
.github/skills/add-pylint-guidelines/SKILL.mdskill describing how to implement new pylint guidelines. - Documents a suggested workflow for adding rules, tests, and updating supporting docs/changelog.
- Provides example commands for running pytest and invoking pylint with the custom plugin.
Comment on lines
+1
to
+4
| --- | ||
| name: add-pylint-guidelines | ||
| description: Create, update, or test custom rules in `azure-pylint-guidelines-checker`. Use when working on implementing/testing the pylint checker. | ||
| --- |
Comment on lines
+15
to
+17
| 2. Define the new guideline you want to add. Clearly specify what coding practice you want to enforce and under what conditions it should be flagged. | ||
| 3. Write a test file in the `tests` directory to cover the new guideline, covering edge cases and using TDD principles. Every guideline should have corresponding tests that verify both that violations are correctly flagged and that compliant code does not trigger false positives. | ||
| 4. Implement the new guideline in the `pylint_guidelines_checker.py` file following existing patterns: |
Comment on lines
+33
to
+37
| cd tools/pylint-extensions/azure-pylint-guidelines-checker | ||
| <ensure a venv is activated> | ||
| pip install -r dev_requirements.txt | ||
| python -m pytest tests/test_pylint_custom_plugins.py::<Test_Name> -v | ||
| ``` |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add missing frontmatter fields: license, metadata.version, metadata.distribution, compatibility, and quote description - Clarify test structure: sample files go in tests/test_files/, assertions in tests/test_pylint_custom_plugins.py - Fix pytest command placeholder to use ::TestClassName::test_method_name Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
skill enabling agent to correctly add custom pylint guidelines