diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50dadca1..3a50e004 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,8 @@ name: Build Cargo Workspace on: workflow_dispatch: push: - branches: ["master"] + branches: + - "*" pull_request: branches: ["master"] diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 62f546a6..72779d4b 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -2,7 +2,8 @@ name: Build Documentation on: workflow_dispatch: push: - branches: ["master"] + branches: + - "*" pull_request: branches: ["master"] diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index f413efba..e03a694a 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -3,7 +3,8 @@ name: Lint Code / Run Tests on: workflow_dispatch: push: - branches: ["master"] + branches: + - "*" paths: - "src/**" - "Cargo.*" @@ -38,12 +39,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - run: rustup toolchain install ${{ matrix.rust }} --profile minimal - uses: Swatinem/rust-cache@v2 - - name: Run rustfmt checks - run: cargo fmt --check - - - name: Run clippy lints - run: cargo clippy -- -D warnings + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 + name: Run pre-commit hooks diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7d8848c6..45b6b777 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,6 +15,10 @@ jobs: - uses: actions/checkout@v3 name: Checkout + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 + name: Run pre-commit hooks + - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/.markdown-link-check.json b/.markdown-link-check.json new file mode 100644 index 00000000..4984e68e --- /dev/null +++ b/.markdown-link-check.json @@ -0,0 +1,3 @@ +{ + "ignorePatterns": ["https://crates.io/crates/asm-lsp"] +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..fa4af8a5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.4.0" + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: check-toml + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + - repo: https://github.com/tcort/markdown-link-check + rev: "v3.10.3" + hooks: + # https://github.com/tcort/markdown-link-check#config-file-format + - id: markdown-link-check + args: ["--progress", "--config", ".markdown-link-check.json"] + - repo: https://github.com/markdownlint/markdownlint + rev: "v0.12.0" + hooks: + - id: markdownlint + exclude: ^.github/ + entry: mdl -r ~MD033,~MD013,~MD034,~MD029,~MD007 + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: "0.27.0" + hooks: + - id: check-github-workflows + args: ["--verbose", "--builtin-schema", "vendor.github-workflows"] + files: ^\.github/workflows/ + types: [yaml] + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + - id: cargo-check + args: ["--locked"] + - id: clippy diff --git a/Cargo.lock b/Cargo.lock index 684164f1..712104f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "asm-lsp" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "flexi_logger", diff --git a/Cargo.toml b/Cargo.toml index fc6f89fe..1c7b3577 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asm-lsp" -version = "0.4.0" +version = "0.4.1" authors = ["Nikos Koukis "] edition = "2018"