Skip to content

Commit

Permalink
Merge branch 'fix-ruff-lint' into 'master'
Browse files Browse the repository at this point in the history
chore(IDX): Fix ruff lint

Ruff-lint needs to be explicitly triggered by pre-commit as well.

We also need to add the `manual` tag, so these checks get triggered by CI. 

See merge request dfinity-lab/public/ic!18175
  • Loading branch information
marko-k0 committed Mar 14, 2024
2 parents bb7d34d + 2651f71 commit f8bb8ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,42 @@ repos:
hooks:
- id: bazel_buildifier
name: Auto format Bazel build files.
stages: [commit]
stages: [commit, manual]
entry: bazel run //:buildifier
files: \.bazel|\.bzl$
language: system

- id: bazel_shfmt_format
name: Auto format shell files
stages: [commit]
stages: [commit, manual]
entry: bazel run //:shfmt-format
files: \.sh$
language: system

- id: bazel_ruff_format
name: Auto format Python files
stages: [commit]
stages: [commit, manual]
entry: bazel run //:ruff-format
files: \.py$
language: system

- id: bazel_ruff_lint
name: Auto lint Python files
stages: [commit, manual]
entry: bazel run //:ruff-lint
files: \.py$
language: system

- id: bazel_protobuf_format
name: Auto format Protobuf files
stages: [commit]
stages: [commit, manual]
entry: bazel run //:protobuf-format
files: \.proto$
language: system

- id: bazel_ormolu_format
name: Auto format Haskell files
stages: [commit]
stages: [commit, manual]
entry: bazel run //:ormolu-format
files: \.hs|\.lhs$
language: system
Expand Down
5 changes: 5 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ alias(
actual = "//pre-commit:ruff-format",
)

alias(
name = "ruff-lint",
actual = "//pre-commit:ruff-lint",
)

alias(
name = "protobuf-format",
actual = "//pre-commit:protobuf-format",
Expand Down
1 change: 1 addition & 0 deletions pre-commit/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sh_test(
"local", # precludes the action or test from being remotely cached, remotely executed, or run inside the sandbox.
"smoke", # it should be run before committing code changes into the version control system.
],
visibility = ["//visibility:public"],
)

sh_binary(
Expand Down

0 comments on commit f8bb8ae

Please sign in to comment.