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

Support custom/no file endings #2

Closed
MichaIng opened this issue Dec 27, 2018 · 8 comments
Closed

Support custom/no file endings #2

MichaIng opened this issue Dec 27, 2018 · 8 comments

Comments

@MichaIng
Copy link

We have a pure bash script project, but the main scripts have no file ending. Those are not checked by CodeFactor and I didn't find any way to add custom file endings for certain languages at all.

Would be great if there was a possibility to do the above. In case of shell scripts, the shebang could be used to identify the language/shell.

@cordis-dev
Copy link
Contributor

Thanks for reporting and sorry for the delayed response.

Unfortunately this feature would be in conflict with our usage of git sparse checkout which allows us to reduce repo disk usage and support more repos at the same time.

A similar trade-off would also be for supporting custom file endings. But if you could provide additional/common bash script file endings we would most likely include them as default.

@MichaIng
Copy link
Author

@cordis-dev
Yeah I understand that cloning the whole repo by default is no proper solution. I guess checking e.g. for a shebang to identify certain script types is as well nothing to achieve trivially, as still all files need to be read.

A similar trade-off would also be for supporting custom file endings. But if you could provide additional/common bash script file endings we would most likely include them as default.

The problem is that in our project we use the shell/bash scripts as programs executable like any other binary from command line as alias respectively from $PATH. It would be simply not beautiful if it was required to start a program like # program_name.sh. Also it is very common on UNIX, a large share of the binaries inside $PATH locations are actually shell scripts and don't have any file endings.

Perhaps it would be considerable if one could add specific files from the repo handled as specific language type. This allows full flexibility while to user needs to do manual steps for each file that does not fit the default file ending rules. Not sure if the Git client provides the feature to achieve this in a clean and efficient way.

@kaskas
Copy link
Contributor

kaskas commented Mar 9, 2019

@MichaIng
thanks for this feature request!

The problem is that in our project we use the shell/bash scripts as programs executable like any other binary from command line as alias respectively from $PATH. It would be simply not beautiful if it was required to start a program like # program_name.sh. Also it is very common on UNIX, a large share of the binaries inside $PATH locations are actually shell scripts and don't have any file endings.

We understand your choice to NOT use file extensions for your scripts. Google's Shell Style Guide also "strongly prefers" not to use extensions for executables https://google.github.io/styleguide/shell.xml#File_Extensions.

Perhaps it would be considerable if one could add specific files from the repo handled as specific language type. This allows full flexibility while to user needs to do manual steps for each file that does not fit the default file ending rules. Not sure if the Git client provides the feature to achieve this in a clean and efficient way.

CodeFactor currently uses file extensions to map files to the respective languages for automated code analysis. Per your suggestion, we have introduced an Epic to CodeFactor's road-map that would support your use-case. There are significant considerations necessary to maintain CodeFactor's UX as frictionless as possible for our user base. We will prioritize implementation based on further needs of our community.

p.s. We love the https://github.com/MichaIng/DietPi project that you are curating!

@MichaIng
Copy link
Author

MichaIng commented May 1, 2019

@kaskas
Many thanks by the way for your understanding and considering this feature request. I stay tuned.

@grm34
Copy link

grm34 commented Apr 26, 2020

Same here, i have to create a specific branch and rename all project files to get it work.

@cordis-dev
Copy link
Contributor

Deployed initial implementation for detecting Bash language files based on first line:

#!/bin/sh
#!/usr/bin/env sh
#!/bin/bash
#!/usr/bin/env bash

@grm34
Copy link

grm34 commented May 4, 2020

@cordis-dev thanks a lot, very appreciate 🖤

@MichaIng
Copy link
Author

MichaIng commented May 4, 2020

@cordis-dev
Awesome, I'll re-enable CodeFactor on our project and see how it goes. Many thanks!

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

No branches or pull requests

4 participants