Files
create/docs/src/development/code-quality.md
forbes-0023 64bde8d97a
Some checks failed
Build and Test / build (pull_request) Has been cancelled
docs: initialize mdBook structure with stub pages and deployment workflow
- Add docs/book.toml with coal theme, repo link, and custom CSS
- Add docs/src/SUMMARY.md with navigation structure
- Create 16 content pages across guide/, architecture/, development/, reference/
- Add docs/theme/kindred.css with minimal sidebar overrides
- Add .gitea/workflows/docs.yml for auto-deploy on push to main
- Add docs/book/ to .gitignore

Pages are populated with real content from the codebase where possible.
Remaining pages have TODO markers for future content.
2026-02-09 07:59:01 -06:00

1.2 KiB

Code Quality

Formatting and linting

C/C++

  • Formatter: clang-format (config in .clang-format)
  • Static analysis: clang-tidy (config in .clang-tidy)

Python

  • Formatter: black with 100-character line length
  • Linter: pylint (config in .pylintrc)

Pre-commit hooks

The repository uses pre-commit to run formatters and linters automatically on staged files:

pip install pre-commit
pre-commit install

Configured hooks (.pre-commit-config.yaml):

  • trailing-whitespace — remove trailing whitespace
  • end-of-file-fixer — ensure files end with a newline
  • check-yaml — validate YAML syntax
  • check-added-large-files — prevent accidental large file commits
  • mixed-line-ending — normalize line endings
  • black — Python formatting (100 char lines)
  • clang-format — C/C++ formatting

Scope

Pre-commit hooks are configured to run on specific directories:

  • src/Base/, src/Gui/, src/Main/, src/Tools/
  • src/Mod/Assembly/, src/Mod/BIM/, src/Mod/CAM/, src/Mod/Draft/, src/Mod/Fem/, and other stock modules
  • tests/src/

Excluded: generated files, vendored libraries (QSint/, Quarter/, 3Dconnexion/navlib), and binary formats.