Contributing

Contributions to wireguard-install are welcome! To ensure a smooth process, please follow these guidelines.

Discuss Changes First

Before you start working on a pull request, especially for significant changes, please open a GitHub issue to discuss your ideas. This helps prevent wasted effort and ensures your proposed changes align with the project's goals.

Remember that this script is meant to be simple and easy to use. Feature requests that add significant complexity may be better suited for a personal fork.

Development Process

  1. Fork the repository on GitHub.
  2. Clone your fork to your local machine.
  3. Create a new branch for your feature or bug fix: git checkout -b my-new-feature.
  4. Make your changes to the wireguard-install.sh script.
  5. Test your changes thoroughly on one or more supported distributions to ensure they work as expected and do not introduce regressions.
  6. Commit your changes with a clear and descriptive message.
  7. Push your branch to your fork on GitHub: git push origin my-new-feature.
  8. Open a pull request against the master branch of the original repository.

Code Formatting and Linting

To maintain code quality and consistency, we use shellcheck and shfmt.

A GitHub Actions workflow automatically checks every pull request, so it's highly recommended to run these tools locally before committing.

shfmt

shfmt is used to format the shell script. To check if your code is formatted correctly, run:

shfmt -d wireguard-install.sh

shellcheck

shellcheck is a static analysis tool that finds common bugs and issues in shell scripts. You can run it with the same options used in the CI pipeline:

shellcheck -e SC1091,SC1117,SC2001,SC2034 wireguard-install.sh

Installing and running these tools locally will help speed up the review process for your contribution.