We welcome contributions to PyWard! Your help can make this linter even better at catching optimization issues and security vulnerabilities. Whether you're fixing a bug, adding a new feature, or improving documentation, your efforts are appreciated.
To contribute to PyWard, please follow these steps:
-
Fork the Repository: Start by forking the PyWard repository on GitHub.
-
Clone Your Fork: Clone your forked repository to your local machine:
git clone [https://github.com/your-username/PyWard.git](https://github.com/your-username/PyWardi.git) cd pyward-cli -
Create a New Branch: Create a new branch for your changes. Please use a descriptive name for your branch, as outlined in the Branch Naming Conventions section below.
git checkout -b feature/your-feature-name
-
Implement Your Changes: Make your desired changes to the codebase. This could involve:
- Adding new optimization checks.
- Implementing new security vulnerability detections.
- Improving existing rules.
- Fixing bugs.
- Enhancing documentation.
-
Add Tests (If Applicable): If you're adding new features or fixing bugs, please include corresponding tests to ensure your changes work as expected and prevent regressions.
-
Run Tests: Before submitting your pull request, make sure all existing tests pass, and your new tests are also passing.
-
Commit Your Changes: Write clear and meaningful commit messages. Good commit messages help others understand the purpose of your changes.
-
Push to Your Fork: Push your new branch to your forked repository on GitHub:
git push origin feature/your-feature-name
Once you've pushed your changes to your fork, you can open a Pull Request (PR) to the main PyWard repository.
- Navigate to your fork on GitHub.
- You should see a banner indicating "This branch is X commits ahead of PyWard:main." or similar, with a "Compare & pull request" button. Click this button.
- Ensure the base branch is
main(ormasterif applicable) and the compare branch is your feature branch. - Provide a clear and concise description for your PR.
- Title: Follow the PR Naming Conventions below.
- Description:
- Explain what your PR does.
- Why is this change necessary or beneficial?
- If it fixes an issue, reference the issue number (e.g.,
Fixes #123). - Include any relevant screenshots or examples if it's a visual change or a new feature.
- Mention any breaking changes or significant impacts if applicable.
- Click "Create pull request."
We will review your PR as soon as possible and may provide feedback or request further changes.
If you find a bug, have a feature request, or want to suggest an improvement, please open an issue on our GitHub Issues page.
When creating an issue, please:
- Check existing issues to avoid duplicates.
- Use a clear and descriptive title.
- For bug reports:
- Provide steps to reproduce the bug.
- Describe the expected behavior.
- Describe the actual behavior.
- Include your Python version and PyWard version.
- Attach any relevant code snippets or error messages.
- For feature requests or improvements:
- Clearly describe the desired feature or improvement.
- Explain why you believe it would be valuable to PyWard.
- Provide any examples or use cases.
To maintain consistency and clarity, please follow these naming conventions:
Use a prefix to indicate the type of change, followed by a concise description.
feature/for new features:feature/add-yaml-linterbugfix/for bug fixes:bugfix/fix-unreachable-code-detectionrefactor/for code refactoring (no new features or bug fixes):refactor/improve-cli-parsingdocs/for documentation updates:docs/update-installation-guidechore/for maintenance tasks, build process, etc.:chore/update-dependencies
Example: git checkout -b feature/new-security-rule
Follow a similar convention to branch names, often in the format Type: Description.
feat:for new features (e.g.,feat: Add detection for unsafe pickle usage)fix:for bug fixes (e.g.,fix: Correct unreachable code detection in loops)refactor:for code refactoring (e.g.,refactor: Optimize AST traversal logic)docs:for documentation changes (e.g.,docs: Clarify contributing guidelines)chore:for maintenance, build-related changes (e.g.,chore: Update development dependencies)security:for security vulnerability fixes or new security checks (e.g.,security: Flag CVE-2025-XXXXX pattern)
Example PR Title: feat: Add new CVE pattern detection
Please adhere to the existing coding style of the PyWard project. We generally follow PEP 8 for Python code. Using a linter like flake8 or a formatter like black can help ensure your code is consistent.
We aim to foster a welcoming and inclusive environment for all contributors. Please refer to our CODE_OF_CONDUCT.md (if you have one) for expected behavior.
Thank you for contributing to PyWard!