Thank you for your interest in contributing to Dead Code Analyzer, a CLI tool for identifying unused code in Flutter and Dart projects! We welcome contributions from the community to improve functionality, documentation, and usability. This document outlines how to contribute effectively.
- How Can I Contribute?
- Getting Started
- Pull Request Process
- Code Style and Conventions
- Community and Communication
- Code of Conduct
If you find a bug, please help us by reporting it:
- Check the GitHub Issues page to ensure the bug hasn’t been reported.
- Open a new issue with a clear title and description, including:
- Steps to reproduce the bug.
- Expected behavior.
- Actual behavior.
- Environment details (e.g., Dart version, OS, Flutter version).
- Screenshots or logs, if applicable.
- Use the
buglabel when creating the issue.
We welcome ideas to improve the tool, such as new features or optimizations:
- Open a GitHub issue with the
enhancementlabel. - Describe the proposed feature, why it’s useful, and any implementation ideas.
- If you plan to work on it, mention this in the issue to avoid duplicate efforts.
You can contribute code to fix bugs, add features, or improve documentation:
- Fork the repository and create a feature branch (e.g.,
feature/add-new-analysisorfix/bug-description). - Follow the Pull Request Process.
- Ensure your code adheres to the Code Style and Conventions.
- Contributions are licensed under the BSD 3-Clause License (see
LICENSE).
- Fork the Repository: Click the "Fork" button on the repository page.
- Clone Your Fork:
git clone git@github.com:jaypal1046/dead_code_analyzer.git cd dead_code_analyzer - Set Up the Upstream Remote:
git remote add upstream https://github.com/jaypal1046/dead_code_analyzer.git
- Install Dependencies:
Ensure Dart and Flutter are installed, then run:
dart pub get
- Create a Feature Branch:
git checkout -b feature/your-feature-name
- Test Your Changes:
- Run the analyzer on a sample Flutter project:
dart bin/dead_code_analyzer.dart -p /path/to/sample/flutter/project --analyze-functions --verbose
- Add or update tests in the
testdirectory if applicable.
- Run the analyzer on a sample Flutter project:
- Commit Changes:
Use clear commit messages (e.g.,
Add support for analyzing abstract classes).git add . git commit -m "Your descriptive commit message"
- Sync with Upstream:
Ensure your fork is up-to-date:
Resolve any merge conflicts.
git fetch upstream git rebase upstream/main
- Push to Your Fork:
git push origin feature/your-feature-name
- Open a Pull Request:
- Go to the repository on GitHub and click "Compare & pull request."
- Provide a clear title and description, linking to related issues (e.g.,
Fixes #123). - Mark as a "Draft" PR if it’s a work in progress.
- Address Feedback:
- Respond to code review comments promptly.
- Make additional commits to address feedback and push to the same branch.
- CI Checks: Ensure any CI checks (if configured) pass. Fix failures if they occur.
- Merging: Once approved, the maintainer will merge your PR. Discuss backporting if needed.
- Follow Dart’s style guide.
- Use
dart formatto format code:dart format . - Write clear, self-documenting code with comments for complex logic.
- Avoid whitespace errors; run
git diff --checkbefore committing. - Update documentation (e.g.,
README.mdor this file) if your changes affect usage. - If adding features, consider updating the CLI’s help text in
dead_code_analyzer.dart.
- Join discussions in GitHub Issues or contact the maintainer via [insert preferred contact method, e.g., email or Discord].
- Be respectful and constructive in all interactions.
- For major changes, open an issue first to discuss with the community.
We are committed to fostering an inclusive community. Please adhere to our Code of Conduct. Report unacceptable behavior to [maintainer’s contact info].