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

Assume Ruby Files for parser #10

Open
wildmaples opened this issue Sep 25, 2020 · 3 comments
Open

Assume Ruby Files for parser #10

wildmaples opened this issue Sep 25, 2020 · 3 comments
Labels
good first issue Good for newcomers

Comments

@wildmaples
Copy link
Contributor

wildmaples commented Sep 25, 2020

To simplify our lives, let's assume that files are Ruby if they aren't recognized by any other parser (for now, that's just .erb). This will eliminate encountering "unknown file type" errors.

If assuming Ruby fails, we'll have to encourage people to use the include / exclude globs in their configs to handle other types of files.

We could assume a file without an extension is an executable, check to see if it looks like a Ruby executable, and ignore it if it's not. @thegedge prefers being explicit, but can understand that a larger repo may have built up a lot of executable files, many of which may not be Ruby.

@wildmaples wildmaples added the good first issue Good for newcomers label Sep 25, 2020
shioyama pushed a commit that referenced this issue May 21, 2021
@yyamanoi1222
Copy link

Hi @wildmaples
I was having a similar problem and found this issue.
In my project I want to check for files that have ruby shebangs.

@alexevanczuk
Copy link
Contributor

Hi @yyamanoi1222 !

We have a PR in progress in packwerk to support custom parsers. Once this merges and we release it, another approach here is that you could define a custom parser that inherits from the existing ruby parser and matches all files except ruby. That way users could opt into this behavior without affecting current behavior.

@yyamanoi1222
Copy link

@alexevanczuk Thank you for reply.
I looking forward to being merge it!

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

No branches or pull requests

3 participants