Thank you for contributing to the Servarr Wiki! This document outlines the setup and guidelines for contributing to this project.
This repository uses pre-commit hooks to ensure code quality and consistency. The hooks are configured to:
- Fix common markdown issues - Format tables, fix trailing whitespace, etc.
- Lint markdown files - Check for markdown syntax and style issues
- Spell check - Catch typos and spelling errors
- Validate YAML/JSON - Ensure configuration files are properly formatted
-
Install Python and pip (if not already installed)
-
Install pre-commit:
pip install pre-commit
-
Install the git hooks:
pre-commit install
Once installed, the hooks will run automatically when you commit changes. You can also run them manually:
# Run on all files
pre-commit run --all-files
# Run on specific files
pre-commit run --files path/to/file.md
# Run a specific hook
pre-commit run markdownlint --all-files- Remove trailing whitespace
- Ensure files end with newline (except in markdown)
- Check YAML and JSON syntax
- Prevent large files from being committed
- Check for merge conflict markers
- Tool: markdownlint-cli
- Config:
.markdownlint.json - Purpose: Ensures consistent markdown formatting and style
- Tool: typos
- Config:
.typos.toml - Purpose: Catches spelling errors and typos
- Tool: prettier
- Purpose: Formats YAML files with consistent indentation
This pre-commit setup specifically addresses:
- Issue #232: Add spell checking CI
Controls markdown linting rules. Key settings:
MD013: false- No line length limitMD033: {...}- Allow specific HTML elementsMD024: { "siblings_only": true }- Allow duplicate headers only if not siblingsMD046: { "style": "fenced" }- Use fenced code blocks
Controls spell checking. Includes:
- Custom dictionary for technical terms
- File patterns to include/exclude
- Words to ignore (like "Arr" applications)
Defines all the hooks and their configuration.
The repository includes GitHub Actions workflows that run the same checks:
- quality-checks.yml: Runs pre-commit hooks on pull requests
- Separate jobs for markdown linting and spell checking
- Caches dependencies for faster builds
- Before committing: Ensure pre-commit hooks are installed and passing
- Markdown style: Follow the existing patterns in the wiki
- Spell check: Add technical terms to the typos configuration if needed
- Testing: Run
pre-commit run --all-filesbefore creating a pull request
# Reinstall hooks
pre-commit uninstall
pre-commit installAdd words to the .typos.toml file in the [default.extend-words] section.
Check the .markdownlint.json configuration or disable specific rules for sections if needed.
If you encounter issues:
- Check this documentation
- Look at existing issues on GitHub
- Create a new issue with the "help wanted" label