The StringyMcStringFace repository uses a comprehensive developer tooling setup to maintain code and documentation quality. This setup includes MegaLinter for multi-language linting, cspell for spell checking, Prettier for code formatting (with custom ignore rules), and a Justfile that orchestrates formatting and linting workflows across platforms. This document explains how each tool is configured and provides guidance for contributors on usage and extension.
MegaLinter Configuration#
MegaLinter is configured in .mega-linter.yml to enforce consistent code quality across the repository. It is set to automatically apply safe fixes (APPLY_FIXES: all). Several directories are excluded from linting, including target, dist, build, node_modules, .git, .cache, coverage, docs/book, and docs/build. This prevents generated files and dependencies from triggering linter errors or slowing down checks.
Specific linter integrations are customized. ActionLint is configured to ignore certain shellcheck issues (SC2086, SC2129, SC2001) in generated files. The FILTER_REGEX_EXCLUDE option excludes files like .github/workflows/release.yml from linting. The Lychee link checker disables progress output, excludes loopback, private, and mail links, and sets a 10-second timeout. The Markdown table formatter skips formatting for README.md. Prettier is run in check mode for JSON and YAML files and respects the .prettierignore file for exclusions.
See MegaLinter config
Spell Checking with cspell#
Spell checking is managed by cspell with a detailed configuration in cspell.config.yaml. The configuration sets the language to English, enables case insensitivity, and allows compound words. It uses multiple dictionaries (en_US, rust, bash, softwareTerms, companies, misc) to cover both general and domain-specific vocabulary.
cspell respects .gitignore and explicitly ignores common build and dependency directories (target/, dist/, build/, node_modules/, .git/, .cache/, coverage/, docs/book/, docs/build/), lock files, and the GitHub release workflow file. Regular expressions are used to skip spell checking for hex hashes, UUIDs, URLs, file paths, code fences, inline code, mermaid diagrams, and base64-like strings.
Language-specific settings tailor spell checking for markdown, YAML, TOML, and JSON files, each with appropriate dictionaries and compound word settings. A custom word list prevents false positives for project-specific terms, Rust ecosystem tools, build/CI tools, binary analysis terms, and technical acronyms.
See cspell config
Prettier Ignore Rules#
The .prettierignore file excludes Markdown files (*.md, **/*.md), generated files and directories (target/, dist/, build/, node_modules/, docs/book/), and .github/workflows/release.yml from Prettier formatting. This ensures that only relevant source files are formatted, avoiding unnecessary changes to generated or external content.
See .prettierignore
Justfile Recipes for Formatting and Linting#
The Justfile defines cross-platform recipes for formatting and linting, ensuring consistency across development environments. Key recipes include:
format: Runs all formatters—Rust code (cargo fmt), JSON/YAML (npx prettier), Markdown (mdformat), and Justfile formatting.lint: Runs all linters—Rust linting (cargo clippy), GitHub Actions workflow linting (actionlint), spell checking (cspell), documentation linting (markdownlint,lychee), and Justfile linting.lint-spell: Runs cspell with the custom config file on all files.format-json-yaml: Formats JSON and YAML files using Prettier.format-docs: Formats Markdown files using mdformat, excludingtargetandnode_modulesdirectories, with separate commands for Windows and Unix.fmtandfmt-check: Format and check Rust code formatting using cargo fmt.lint-rustandlint-rust-min: Run cargo clippy with all features or no default features, denying warnings.fmt-justfileandlint-justfile: Format and lint the Justfile itself using just --fmt.megalinter: Runs MegaLinter with the Rust flavor using npx mega-linter-runner.
The Justfile also includes setup recipes to install Rust components, cargo-binstall, mdformat and its extensions, and pipx for Python tool management, streamlining local development environment setup.
See Justfile
Using and Extending the Tooling#
To use the tooling, contributors can run just format to format all code and documentation, and just lint to run all linters and spell checkers. Individual recipes are available for more granular control, such as just lint-spell for spell checking or just format-json-yaml for formatting JSON/YAML files.
To extend the setup:
- Add new words to the
wordslist incspell.config.yamlto prevent false positives for project-specific terminology. - Modify ignore patterns in
.prettierignoreorcspell.config.yamlto adjust which files are excluded from formatting or spell checking. - Add or modify Justfile recipes to introduce new formatting or linting steps, or to support additional tools.
- Update
.mega-linter.ymlto change linter behavior, add new exclusions, or adjust tool-specific arguments.
This setup is designed for both local development and CI workflows, ensuring that code and documentation remain consistently formatted, linted, and free of spelling errors. Contributors are encouraged to use the Justfile commands for a unified workflow and to keep configuration files up to date as the project evolves.