-
Notifications
You must be signed in to change notification settings - Fork 94
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
[Feature] Integration with shellcheck #72
Comments
Right now there are various optimization that we can do to be more aligned with shellcheck:
|
So looking at the error below, everytime Amber print a variable it should wrap them. In this way various error are automatically fixed. For I think that it will be cool if the bash generated is ShellCheck "approved". |
Another Amber example:
Generate this bash code:
For shellcheck the last like should be:
|
We should add shellcheck tests for Amber compiled code and stdlib tests @Mte90 |
Yes when we will address all of them is something we can do |
So seems that it is possible to use Shellcheck to autofix the errors that find it.
Basically generating a diff file and using git to apply, so in the meantime we can integrate it if the machine has the tool. |
@Mte90 I want to make it right. Let"s make shellcheck tests on the bash code that gets produced by the Amber validity and stdlib tests |
Usecase
As a DevSecOps specialist, I regularly enforce a check stage for all bash scripts in our project repository utilizing shellcheck, a tool that provides linting for bash scripts to ensure they are written following best practices and avoid common mistakes.
I am interested in experimenting with writing my automation scripts using the Amber scripting language and then compiling them into bash scripts. Ьн CI/CD system currently only permits the execution of bash scripts.
To streamline this workflow, I am seeking a feature in Amber that would allow the automatic generation of bash scripts that are compliant with shellcheck standards right out of the box. This would enable me to leverage the power and convenience of Amber without the need for post-processing or manual corrections on the generated bash scripts.
The ability to do this would ensure that we maintain our code quality and security standards without compromising on efficiency or having to disable shellcheck for these generated scripts.
The text was updated successfully, but these errors were encountered: