pre-commit:
  parallel: true
  jobs:
    - name: fmt
      run: rustfmt --edition 2021 {staged_files}
      glob: "*.rs"
      exclude:
        - "crates/macros/tests/expand/*.expanded.rs"
      stage_fixed: true
    - name: clippy
      run: cargo clippy --workspace --all-targets --features closure,embed,anyhow,observer -- -W clippy::pedantic -D warnings
      glob: "*.rs"
    - name: bindings
      run: tools/update_bindings.sh && git diff --exit-code docsrs_bindings.rs
      glob: "allowed_bindings.rs"
      fail_text: |
        The `docsrs_bindings.rs` file seems to be out of date.
        Please check the updated bindings in `docsrs_bindings.rs` and commit the changes.
    - name: "macro docs"
      run: tools/update_lib_docs.sh
      glob:
        - "guide/src/macros/*.md"
        - "crates/macros/src/lib.rs"
      stage_fixed: true
