aspect-build / aspect-build/rules_lint

Add a way to lint pyi files

Open
#559 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
154
Forks
125
Avg merge
3d 21h
Merged PRs (30d)
20

Description

I'd like to lint my pyi files, but currently it doesn't look like there's a way to do it. lint_ruff_aspect only looks at py_binary, py_library and py_test targets, but they can only take .py files as srcs, not .pyi files.

Looks like the easiest way to do this would be to make the aspect also look at filegroups tagged 'python', like the vale linter does for markdown.

This would have the added benefit of being able to lint files that don't really belong in a py_* target, e.g. scripts intended to be run outside bazel, without having to create a dummy py_* rule for them - they could just go in a tagged filegroup instead. I'd be inclined to add this to shellcheck as well, for the same reason.

Contributor guide

Open the contributing guide

Research direction

Start by reading the lint_ruff_aspect implementation and the Vale linter's handling of markdown filegroups tagged "python". Determine how tagged filegroups should be included, then verify that .pyi files and standalone Python scripts in those filegroups are linted without requiring a py_* target.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.