Skip to content

Commit

Permalink
adding flake8 back, still need to find how to do dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanDuPont committed Mar 25, 2024
1 parent 299a09a commit cdf3afe
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Bazel configurations set for this repository. You

# can also set local configs in your ~/.bazelrc file.

common --enable_bzlmod
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
# TODO
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: CI

on:
push:
pull_request:
branches: [main]

concurrency:
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
format:
uses:
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
7 changes: 7 additions & 0 deletions tools/lint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@ alias(
}),
)

# We can test that it works with:
# bazel run :flake8 -- --help
py_console_script_binary(
name = "flake8",
pkg = "@pip//flake8:pkg",
)

# bazel run :shellcheck -- --help
shellcheck_binary(name = "shellcheck")
8 changes: 8 additions & 0 deletions tools/lint/linters.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"Define linter aspects."
# Copied from https://github.com/aspect-build/rules_lint/blob/main/example/tools/lint/linters.bzl

load("@aspect_rules_lint//lint:flake8.bzl", "lint_flake8_aspect")
load("@aspect_rules_lint//lint:lint_test.bzl", "lint_test")
load("@aspect_rules_lint//lint:ruff.bzl", "lint_ruff_aspect")
load("@aspect_rules_lint//lint:shellcheck.bzl", "lint_shellcheck_aspect")
Expand All @@ -15,6 +16,13 @@ ruff = lint_ruff_aspect(

ruff_test = lint_test(aspect = ruff)

flake8 = lint_flake8_aspect(
binary = "@@//tools/lint:flake8",
config = "@@//:.flake8",
)

flake8_test = lint_test(aspect = flake8)

shellcheck = lint_shellcheck_aspect(
binary = "@@//tools/lint:shellcheck",
config = "@@//:.shellcheckrc",
Expand Down

0 comments on commit cdf3afe

Please sign in to comment.