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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Add option for declaring language within file #195

Open
Jasper-Ben opened this issue Sep 6, 2022 · 2 comments
Open

Question: Add option for declaring language within file #195

Jasper-Ben opened this issue Sep 6, 2022 · 2 comments

Comments

@Jasper-Ben
Copy link
Contributor

馃憢

I am considering adding support for bitbake, however some of the file extensions used by bitbake are quite ambiguous, such as *.class, *.inc, which might collide with other languages added in the future. As such I propose adding support for declaring the language within a comment within the scanned file, e.g.: # todockeck-lang=bitbake for such cases.

Is this something you would feel comfortable with @preslavmihaylov?

@preslavmihaylov
Copy link
Owner

I think this configuration knob will be a bit cumbersome to use, especially if you have to put it in every file you have.

Alternatively, I think what is more appropriate is to add an "auto-detect lang" feature - instead of determining the language based on extension, todocheck can detect it based on its syntax.

There ought to be some libs out there which can do the job.

If you're up to tinkering with this, I am happy to add it into the tool as a fallback mechanism to determine language instead of using extension.

@Jasper-Ben
Copy link
Contributor Author

Alternatively, I think what is more appropriate is to add an "auto-detect lang" feature - instead of determining the language based on extension, todocheck can detect it based on its syntax.

Mhm, I am not thrilled with the idea. IMO auto-discovery would be way to complex and error prone.

There ought to be some libs out there which can do the job.

At least for our use-case there probably isn't. Bitbake is a bit too niche for that.

I have an alternative proposal:
How about an option of setting the language for a specific extension within the projects todocheck config? So rather than on a per-file basis on a per-project basis. That would be less cumbersome while avoiding the complexity of syntax detection.

Later on support for overriding project-wide settings on a per-file basis could be added. This would also be useful for supporting files that do not have an extension, e.g. Dockerfile or Dockerfile-testing.

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

No branches or pull requests

2 participants