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

Implement Format Checks for Groovy Code in GitHub Actions Workflow #16

Merged
merged 1 commit into from
May 24, 2024

Conversation

karim20230
Copy link
Member

In this change, I have implemented a new GitHub Actions workflow named "Format-checks". This workflow is triggered on every push and pull request to the 'main' branch.

This change will help to ensure that all Groovy code in the repository adheres to our coding standards and best practices, and will prevent code with formatting errors from being merged into the 'main' branch.

--failon error -The command will cause the workflow to fail if any errors are detected by GroovyLint.

@karim20230 karim20230 requested a review from a team May 8, 2024 12:36
cazfi
cazfi previously requested changes May 9, 2024
.github/workflows/format-checks.yml Outdated Show resolved Hide resolved
@mkaapu
Copy link
Contributor

mkaapu commented May 10, 2024

Jenkins Declarative Pipeline is not exactly groovy, but simple text scripts that use a Pipeline DSL (domain-specific language) based on the Groovy programming language.
There are better option for linting Pipeline scripts and Jenkins installation itself comes with linter tool:
https://www.jenkins.io/doc/book/pipeline/development/

@karim20230 karim20230 force-pushed the add-grovyLint-github-action branch 2 times, most recently from 3799e0d to c4d16fc Compare May 22, 2024 15:10
@karim20230 karim20230 requested a review from cazfi May 22, 2024 15:13
@karim20230
Copy link
Member Author

karim20230 commented May 22, 2024

Jenkins Declarative Pipeline is not exactly groovy, but simple text scripts that use a Pipeline DSL (domain-specific language) based on the Groovy programming language. There are better option for linting Pipeline scripts and Jenkins installation itself comes with linter tool: https://www.jenkins.io/doc/book/pipeline/development/

Yeah agreed! also npm-groovy-lint tool is designed to lint Groovy code, issues in a Jenkins Pipeline script. the tool can check Groovy code for example style issues, potential bugs, and other problems. for example Runing npm-groovy-lint with the --fix option on all files in the directory. The --fix option automatically fixes any fixable issues in the code.

@karim20230 karim20230 force-pushed the add-grovyLint-github-action branch 2 times, most recently from 08cb474 to 818eeb0 Compare May 22, 2024 15:42
README.md Outdated Show resolved Hide resolved
.github/workflows/format-checks.yml Outdated Show resolved Hide resolved
.github/workflows/format-checks.yml Outdated Show resolved Hide resolved
.github/workflows/format-checks.yml Outdated Show resolved Hide resolved
@karim20230 karim20230 force-pushed the add-grovyLint-github-action branch 2 times, most recently from 49fa233 to 875710b Compare May 23, 2024 13:17
@karim20230
Copy link
Member Author

Although there are warnings and informational messages, there are zero errors reported.

I believe that means the code compiles and functions as intended. btw though checks fails we maybe need to improve code style!

@karim20230 karim20230 force-pushed the add-grovyLint-github-action branch from 875710b to d066966 Compare May 24, 2024 08:07
@karim20230 karim20230 merged commit 284cecd into tiiuae:main May 24, 2024
1 check passed
@karim20230 karim20230 deleted the add-grovyLint-github-action branch May 24, 2024 08:21
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

Successfully merging this pull request may close these issues.

4 participants