Skip to content

Commit

Permalink
Merge pull request #100 from ai-cfia/99-as-a-devops-i-would-like-to-h…
Browse files Browse the repository at this point in the history
…ave-automated-linting-for-sh-scripts

Issue #99: As a devops i would like to have automated linting for sh scripts
  • Loading branch information
SonOfLope authored Mar 1, 2024
2 parents 7fd0e18 + 2cf4bbe commit d8cdf97
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/workflow-sh-check.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions .github/workflows/workflow-sh-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Check SH scripts conformance to AI Lab standards

on:

Check warning on line 4 in .github/workflows/workflow-sh-check.yml

View workflow job for this annotation

GitHub Actions / yaml-lint-check

4:1 [truthy] truthy value should be one of [false, true]
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

0 comments on commit d8cdf97

Please sign in to comment.