Repository: doublify/pre-commit-rust Branch: master Commit: eeee35a89e69 Files: 5 Total size: 2.5 KB Directory structure: gitextract_wkosdyzt/ ├── .github/ │ └── workflows/ │ └── auto-tag.yml ├── .pre-commit-config.yaml ├── .pre-commit-hooks.yaml ├── README.md └── hooks.yaml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/auto-tag.yml ================================================ name: Release on: push: branches: - master jobs: release: runs-on: ubuntu-latest steps: - id: compute_tag uses: craig-day/compute-tag@v10 with: github_token: ${{ github.token }} version_scheme: continuous version_type: major - name: create release uses: actions/create-release@v1 with: tag_name: ${{ steps.compute_tag.outputs.next_tag }} release_name: ${{ steps.compute_tag.outputs.next_tag }} body: > Automatic release of ${{ steps.compute_tag.outputs.next_tag }} env: GITHUB_TOKEN: ${{ github.token }} ================================================ FILE: .pre-commit-config.yaml ================================================ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.1.0 hooks: - id: check-byte-order-marker - id: check-case-conflict - id: check-merge-conflict - id: check-symlinks - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/pre-commit/pre-commit rev: v2.5.1 hooks: - id: validate_manifest ================================================ FILE: .pre-commit-hooks.yaml ================================================ - id: fmt name: fmt description: Format files with cargo fmt. entry: cargo fmt language: system types: [rust] args: ["--"] - id: cargo-check name: cargo check description: Check the package for errors. entry: cargo check language: system types: [rust] pass_filenames: false - id: clippy name: clippy description: Lint rust sources entry: cargo clippy language: system args: ["--", "-D", "warnings"] types: [rust] pass_filenames: false ================================================ FILE: README.md ================================================ # Rust hooks for pre-commit [Rust](https://www.rust-lang.org) tools package for [pre-commit](https://pre-commit.com). ## Using rust tools with pre-commit ```yaml - repo: https://github.com/doublify/pre-commit-rust rev: master hooks: - id: fmt - id: cargo-check ``` ## Passing arguments to rustfmt ```yaml - repo: https://github.com/doublify/pre-commit-rust rev: master hooks: - id: fmt args: ['--verbose', '--edition', '2018', '--'] ``` ================================================ FILE: hooks.yaml ================================================ - id: fmt name: fmt description: Format files with cargo fmt. entry: cargo fmt -- language: system files: \.rs$ args: [] - id: cargo-check name: cargo check description: Check the package for errors. entry: cargo check language: system files: \.rs$ pass_filenames: false - id: cargo-clippy name: cargo clippy description: Run the Clippy linter on the package. entry: cargo clippy -- -D warnings language: system files: \.rs$ pass_filenames: false