Skip to content

feat(lint): support configurable paths - #1781

Open
ayushmishra2005 wants to merge 1 commit into
Syndica:mainfrom
ayushmishra2005:feat/lint-configurable-paths
Open

ayushmishra2005 wants to merge 1 commit into
Syndica:mainfrom
ayushmishra2005:feat/lint-configurable-paths

Conversation

@ayushmishra2005

Copy link
Copy Markdown

Closes #1757

Intent

  • Allow sig-lint to run against specific files or directories instead of relying only on paths defined in source.
  • Preserve the existing full-project lint behavior when no custom paths are supplied.

Implementation

  • Added repeatable --path <path> arguments.
    zig build lint -- --path tools/lint
    zig build lint -- --path tools/lint --path v2/lib
    
  • Explicit paths replace the default project paths for that run.
  • Directories are scanned recursively, while explicit files must be Zig source files.
  • Paths are resolved relative to the repository root and normalized before collection.
  • Duplicate and overlapping inputs are deduplicated before files are parsed.
  • Scoped runs only validate relevant line-length exclusions and test-inclusion roots.
  • Exact-file runs apply file-level rules without triggering directory-level test-inclusion checks.
  • The lint run step now uses the repository root as its working directory.
  • Updated the README with the new usage.

Test

Validated with Zig 0.15.2:

zig fmt --check build.zig tools/lint
zig build lint
zig build lint -- --help
zig build lint -- --path tools/lint/main.zig
zig build lint -- --verbose --path tools/lint --path v2/lib

@github-project-automation github-project-automation Bot moved this to 🏗 In progress in Sig Aug 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Lint tool configurability

1 participant