Skip to content

How to add additional cfc-lint module? #274

Description

@keironlowe-edriving

Hi, I'm trying to implement this with the additional Serverless Rules module but it doesn't work. It fails with the following error...

2023-03-28 14:49:11,320 - cfnlint - ERROR - Tried to append rules but got an error: No module named 'cfn_lint_serverless'

Not 100% familiar with Python, but could it be that you're setting up a virtual python env? So when I do pip install cfn-lint-serverless it's not being installed into the correct env? If so, could a possible solution be to add the path to the virtual env as an output for the step?

Below is my workflow file...

name: CI

on:
  pull_request:

jobs:
  cfn_lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup Cloud Formation Linter with Latest Version
        uses: scottbrenner/cfn-lint-action@v2

      - run: pip install cfn-lint-serverless

      - name: Print the Cloud Formation Linter Version & run Linter.
        run: |
          cfn-lint --version
          cfn-lint -t template.yaml -a cfn_lint_serverless.rules

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions