Question
· Jun 24

Using CodeTidy in my GitHub automated workflow for linting ObjsectScript code

I installed and configure CodeTidy in my local development environment, without InterSystems source-control (git-source-control) and only git for source control.

I would like to use only CodeTidy to stablish an automated  Linting and Code Style Validation for InterSystems ObjectScript code triggered by GitHub Actions.

 

Could you shed some light on how to accomplish that?

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1.1 (Build 362U) Mon Aug 1 2022 14:12:03 EDT
Discussion (3)4
Log in or sign up to continue

To set up an automated linting and code style validation for InterSystems ObjectScript code using CodeTidy and GitHub Actions:

  1. Install the CodeTidy Package:

    • Ensure that you have ObjectScript Package Manager (ZPM) installed.
    • Use the command:
      zpm "install isc.codetidy"
      This will install the CodeTidy package required for linting ObjectScript code [1].
  2. Configure GitHub Actions Workflow:

    • Create a GitHub Actions workflow file in your repository. For example, create a file .github/workflows/objectscript-linting.yml.
    • Define your GitHub Action to include steps where CodeTidy is executed during your CI pipeline.
    • Example workflow:

      name: ObjectScript Lint
      
      on:
      push:
       branches:
         - main
      pull_request:
      
      jobs:
      lint:
       runs-on: ubuntu-latest
       steps:
       - name: Checkout code
         uses: actions/checkout@v3
      
       - name: Install dependencies (ZPM if needed)
         run: |
           # Install ObjectScript Package Manager (if not pre-installed)
           zpm "install isc.codetidy"
      
       - name: Run CodeTidy for linting
         run: |
           # Add commands here to invoke CodeTidy linting
           # as per its documentation
      

      Customize this template based on your CodeTidy usage and specific requirements. Integrate any file exclusions or specific rules for your linting process [1][2].

Refer to the CodeTidy Documentation for specific commands and configurations related to linting operations [1].

Sources: