Skip to content

ScribeMD/pre-commit-hooks

Repository files navigation

pre-commit-hooks

Git Hooks Test Workflow Status Copy/Paste: 0%

Automated Updates: Renovate Package Management: Poetry Git Hooks: pre-commit Commit Style: Conventional Commits Releases: Semantic Versioning Code Style: Prettier Code Style: EditorConfig Editor: Visual Studio Code

Hooks for Use With the pre-commit Framework

Pre-commit only supports Git and no other version control system (VCS). The defaults for the Yarn hooks are configured for use with a Zero-Installs TypeScript project. They assume Yarn and Node.js are managed by asdf, but the file patterns may be overridden.

Hooks

no-merge-commits

Prevent new merge commits. Useful for enforcing rebase workflows. Does not stop merge committing in CI.

asdf-install

Install tools (based on .tool-versions unless otherwise configured) by running asdf install.

poetry-check

Validate structure of pyproject.toml by running poetry check. Run when Poetry dependencies or version changes (assuming Poetry is managed by asdf, but the file pattern may be overridden).

poetry-lock

Update poetry.lock to match pyproject.toml without upgrading already locked dependencies by running poetry lock --no-update. Run when Poetry dependencies or version changes (assuming Poetry is managed by asdf, but the file pattern may be overridden).

poetry-install

Install Poetry dependencies from poetry.lock by running poetry install --sync. Uninstall any dependencies not found in the lock file. Requires Poetry 1.2+.

pre-commit-install

Install pre-commit hooks by running pre-commit install --install-hooks. See also the documentation for default_install_hook_types.

yarn-install

Install Yarn dependencies, and update yarn.lock by running yarn install.

yarn-dedupe

Deduplicate Yarn dependencies by running yarn dedupe.

yarn-audit

Perform security audit of Yarn dependencies by running yarn npm audit --all --recursive.

yarn-sdks

Generate SDKs and settings for editors specified in .yarn/sdks/integrations.yml by running yarn run sdks && yarn run prettier --write .vscode/settings.json. Format VSCode settings with Prettier to prevent formatting conflicts with MegaLinter.

yarn-build

Run the build script in package.json via yarn run build.

yarn-test

Run the test script in package.json via yarn run test --passWithNoTests --findRelatedTests. Useful for running Jest tests that check the modified files, but the flag can be overridden.

megalinter-incremental

This hook is intended for MegaLinter v6. Run MegaLinter (skipping linters that run in project mode) by running:

npx -- mega-linter-runner@v7.7.0 \
  --container-name megalinter-incremental \
  --remove-container \
  --fix \
  --env LOG_LEVEL=warning \
  --filesonly

See the documentation for mega-linter-runner and MegaLinter configuration.

megalinter-full

This hook is intended for MegaLinter v6. Run MegaLinter by running:

npx -- mega-linter-runner@v7.7.0 \
  --container-name megalinter-full \
  --remove-container \
  --fix \
  --env LOG_LEVEL=warning \

See the documentation for mega-linter-runner and MegaLinter configuration.

Changelog

Please refer to CHANGELOG.md.