From 9ec8f036f7c5bbfdc2fa103fc93fe2fe491f36ac Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Fri, 1 Mar 2024 15:49:48 -0500 Subject: [PATCH 1/2] Issue #99: Adding sh linting reusable workflow --- .github/workflows/workflow-sh-check.md | 24 ++++++++++++++++++++++++ .github/workflows/workflow-sh-check.yml | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/workflow-sh-check.md create mode 100644 .github/workflows/workflow-sh-check.yml diff --git a/.github/workflows/workflow-sh-check.md b/.github/workflows/workflow-sh-check.md new file mode 100644 index 00000000..213d935c --- /dev/null +++ b/.github/workflows/workflow-sh-check.md @@ -0,0 +1,24 @@ +# Reusable Workflow for SH Script Conformance + +## Overview + +This workflow ensures that Shell scripts adhere to AI Lab's coding standards. +It's designed to automatically check the conformance of SH scripts to maintain +consistency and quality in the codebase. + +## Usage + +- **Purpose:** Automatically validate SH scripts against AI Lab's standards. It + triggers on workflow calls or push events, reviewing the scripts for + compliance. +- **Steps** + - Checkout Code: Fetches the latest code from the repository to be checked. + - Run ShellCheck: Executes ShellCheck, a tool for linting and static analysis + of SH scripts, to ensure they meet the predefined standards. + +## SH Scripting Guidelines for Developers + +- It's recommended to integrate + [ShellCheck](https://github.com/koalaman/shellcheck) in your local development + environment to catch issues early. ShellCheck provides detailed feedback for + improving your SH scripts, adhering to best practices and coding standards. diff --git a/.github/workflows/workflow-sh-check.yml b/.github/workflows/workflow-sh-check.yml new file mode 100644 index 00000000..bc087c99 --- /dev/null +++ b/.github/workflows/workflow-sh-check.yml @@ -0,0 +1,16 @@ +--- + name: Check SH scripts conformance to AI Lab standards + + on: + workflow_call: + push: + + jobs: + sh-lint-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run ShellCheck + uses: azohra/shell-linter@latest From 2cf4bbe541b95dd3ab173e600dbc5a3e244ba2c5 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Fri, 1 Mar 2024 15:52:58 -0500 Subject: [PATCH 2/2] Issue #99: Resolving yaml violations --- .github/workflows/workflow-sh-check.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow-sh-check.yml b/.github/workflows/workflow-sh-check.yml index bc087c99..1eb87706 100644 --- a/.github/workflows/workflow-sh-check.yml +++ b/.github/workflows/workflow-sh-check.yml @@ -1,16 +1,15 @@ --- - name: Check SH scripts conformance to AI Lab standards +name: Check SH scripts conformance to AI Lab standards - on: - workflow_call: - push: +on: + workflow_call: + push: - jobs: - sh-lint-check: +jobs: + sh-lint-check: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run ShellCheck - uses: azohra/shell-linter@latest + - name: Checkout code + uses: actions/checkout@v4 + - name: Run ShellCheck + uses: azohra/shell-linter@latest