Contributing

Contributions to the disk-burnin.sh script are welcome. Whether it's fixing a bug, improving compatibility, or adding a new feature, your help is appreciated.

Development Guidelines

To ensure the script remains robust, portable, and easy to maintain, please adhere to the following guidelines.

1. POSIX Compliance

The script is intended to be POSIX-compliant to run on a wide variety of Unix-like operating systems. Avoid using shell features specific to bash (bashisms) or other modern shells. All code should be written for a standard /bin/sh interpreter.

2. Static Analysis with shellcheck

Before submitting any changes, please run your code through shellcheck, a static analysis tool for shell scripts. It helps to identify common bugs, syntax errors, and non-portable constructs.

# Install shellcheck (e.g., on Debian/Ubuntu)
sudo apt-get install shellcheck

# Run shellcheck on the script
shellcheck disk-burnin.sh

Your changes should not introduce any new shellcheck warnings.

3. Editor Configuration

The repository includes an .editorconfig file. This file helps maintain consistent coding styles (like indentation and whitespace) between different editors and IDEs. Please ensure your editor has a corresponding plugin to respect these settings.

  • Indent Style: space
  • Indent Size: 2
  • Charset: utf-8
  • End of Line: lf

4. Code Style and Comments

  • Write clear, concise code.
  • Add comments to explain complex logic or the purpose of a function.
  • Follow the existing style for variable naming (UPPER_CASE for global constants, lower_case for local variables) and function definitions.

How to Contribute

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix: git checkout -b my-new-feature.
  3. Make your changes following the guidelines above.
  4. Test your changes thoroughly on at least one Linux distribution and, if possible, a BSD-based system.
  5. Commit your changes with a clear and descriptive commit message.
  6. Push your branch to your fork: git push origin my-new-feature.
  7. Create a new Pull Request on GitHub, describing the problem you're solving and the changes you've made.