Skip to content

Add lint-configuration through comments #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JonatanWaern
Copy link
Contributor

  • Clean trailing whitespace
  • Dont move string for begin_style_check
  • Re-enable main lint test
  • Add support for lint configuration annotations in comments
  • Introduce the USAGE.md file

@JonatanWaern
Copy link
Contributor Author

Fixes #121

@JonatanWaern JonatanWaern requested a review from TSonono July 18, 2025 14:39
@JonatanWaern
Copy link
Contributor Author

@jvsqzj your insight is valuable here, as well, if you have any thoughts on this

Copy link

@TSonono TSonono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it up to you if you want to wait for further reviewing before merging.

@JonatanWaern JonatanWaern force-pushed the lint-annotations branch 2 times, most recently from 21b523f to f61f217 Compare July 29, 2025 11:56
@JonatanWaern
Copy link
Contributor Author

@anankos-intel any opinions/suggestions on syntax for this?

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for lint configuration through inline comments, allowing users to disable specific linting rules on a per-file or per-line basis. It also includes code cleanup and re-enables a main lint test.

  • Introduces lint annotation syntax // dls-lint: <command>=<target> with support for allow and allow-file commands
  • Adds comprehensive parsing and validation for lint annotations with proper error reporting
  • Implements FromStr trait for RuleType enum to enable string-to-rule conversion

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lint/rules/tests/mod.rs Changed common module visibility to public
src/lint/rules/tests/common.rs Updated function signature to use string slice and removed unnecessary clones
src/lint/rules/mod.rs Added Copy trait and Configuration variant to RuleType, implemented FromStr
src/lint/mod.rs Core implementation of lint annotation parsing, filtering, and integration
USAGE.md Added comprehensive documentation for inline lint configuration feature
README.md Updated to reference the new USAGE.md file
CHANGELOG.md Added entry documenting the new lint annotation feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants