Skip to content
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

feat(harper-core): Mark shebangs as unlintable #421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sohunpatel
Copy link

Closes #65.

Changes

  • Adds check to see if the content is a shebang, in the parse function.
  • Add test to comment parser to make sure that comments with shebang are ignored

I am not sure if this is a great solution since this should only apply to comment parsers, but I could not find an elegant solution for that.

@grantlemons
Copy link
Collaborator

I think a better solution would be to mask them out in harper-tree-sitter. See fd5ebae.

@elijah-potter
Copy link
Collaborator

@grantlemons, @sohunpatel I think the best way to do this would be to create a new implementaion of the Masker trait that ignores lines with shebangs. From there, it'd wrap it around the inner Masker that CommentParser uses internally.

Let me know if you have any questions about any of that.

@elijah-potter elijah-potter added enhancement New feature or request rust Pull requests that update Rust code harper-comments labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request harper-comments rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: ignore shebangs
3 participants