Contributing to asnmap
Thank you for your interest in contributing to asnmap! We welcome contributions from the community to help make this tool even better. Whether it's a bug report, a new feature, or documentation improvements, your help is appreciated.
Setting Up the Development Environment
To get started with development, you'll need to set up a local environment.
-
Prerequisites:
- Go version 1.21 or later.
- Git.
-
Clone the Repository:
git clone https://github.com/projectdiscovery/asnmap.git cd asnmap -
Install Dependencies: The dependencies are managed by Go modules. You can tidy them up to ensure everything is in place.
go mod tidy
Building from Source
The project includes a Makefile to simplify the build process.
make cli
This will compile the source code and create an asnmap binary in the current directory.
Running Tests
asnmap has a suite of tests to ensure code quality and correctness. Before submitting any changes, please run the tests to make sure everything is working as expected.
Note: The test suite requires a valid ProjectDiscovery Cloud Platform (PDCP) API key to be set as an environment variable, as it makes live API calls.
export PDCP_API_KEY="YOUR_API_KEY_HERE"
make test
Code Style and Linting
We use golangci-lint to maintain a consistent code style and catch common errors. The CI/CD pipeline will automatically run the linter on all pull requests.
You can run the linter locally by installing golangci-lint and executing it in the project root:
golangci-lint run
Submitting a Pull Request
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix:
git checkout -b my-new-feature. - Make your changes and commit them with a clear, descriptive message.
- Push your branch to your fork:
git push origin my-new-feature. - Open a Pull Request against the
devbranch of the officialprojectdiscovery/asnmaprepository.
Please provide a detailed description of your changes in the pull request. The maintainers will review your contribution, provide feedback, and merge it when it's ready.