Skip to content

Commit

Permalink
chore: generate API docs for flake8
Browse files Browse the repository at this point in the history
Part 3 of the 'adding a linter' guide
  • Loading branch information
alexeagle committed Oct 12, 2023
1 parent 3efc2fe commit 949c47e
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ We have a separate project for formatting, see <https://github.com/aspect-build/
- `buf lint`: <https://buf.build/docs/lint/overview>
- JavaScript
- `eslint`: https://eslint.org/
- Python
- `flake8`: <https://flake8.pycqa.org/en/latest/index.html>

### Adding a linter

Expand Down
5 changes: 5 additions & 0 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ stardoc_with_diff_test(
bzl_library_target = "//lint:eslint",
)

stardoc_with_diff_test(
name = "flake8",
bzl_library_target = "//lint:flake8",
)

update_docs(name = "update")
74 changes: 74 additions & 0 deletions docs/flake8.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions lint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ bzl_library(
"@aspect_rules_js//js:libs",
],
)

bzl_library(
name = "flake8",
srcs = ["flake8.bzl"],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ https://github.com/aspect-build/rules_lint/commit/29d275bcf7ecf5b99c6bff6913322f

Add a rule in the `docs/` folder matching the existing ones, so that the API docs are auto-generated.
Run `bazel run docs:update` to create the Markdown file.

Also add your new linter to the README.

Here's a commit showing what it should look like:
Expand Down

0 comments on commit 949c47e

Please sign in to comment.