cyberneticlibrary

Configure code formatting tools

setup-formattingcommandsetup L20
xSoVx/dc-adapter-rmc
What it does

Configure language-specific code formatting tools and precommit hooks

Best for

Enforcing consistent code formatting across teams when IDE-level enforcement and git hooks are required, beyond manual reviewer comments.

Inputs
  • · Target languages: JavaScript/TypeScript/Python/Java
  • · Project package.json location
Outputs
  • · Formatter config files (.prettierrc, pyproject.toml, .lintstagedrc)
  • · npm scripts for format/format:check
  • · Husky + lint-staged pre-commit hooks
Requires
  • · npm
  • · pip
  • · husky
  • · lint-staged
  • · prettier
  • · ESLint
Preconditions
  • · Node.js and npm installed
  • · Python >= 3.8 for Python projects
  • · Git repository initialized
Failure modes
  • · Formatter installation fails if npm/pip not in PATH
  • · Pre-commit hooks not run if git hooks not executable
  • · IDE extensions not installed = format-on-save doesn't work
Trust signals
  • · Includes working examples for 3+ languages
  • · Provides both IDE and CLI automation paths
  • · Pre-commit hook pattern is industry standard