Skip to content

devskim GitHub last commit

devskim documentation

DevSkim - GitHub

Configuration in MegaLinter

Variable Description Default value
REPOSITORY_DEVSKIM_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
REPOSITORY_DEVSKIM_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
Exclude every file
REPOSITORY_DEVSKIM_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
REPOSITORY_DEVSKIM_PRE_COMMANDS List of bash commands to run before the linter None
REPOSITORY_DEVSKIM_POST_COMMANDS List of bash commands to run after the linter None
REPOSITORY_DEVSKIM_DISABLE_ERRORS Run linter but consider errors as warnings false
REPOSITORY_DEVSKIM_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0

IDE Integration

Use devskim in your favorite IDE to catch errors before MegaLinter !

IDE Extension Name Install
Visual Studio Code VsCode DevSkim Install in VsCode

MegaLinter Flavours

This linter is available in the following flavours

Flavor Description Embedded linters Info
all Default MegaLinter Flavor 101 Docker Image Size (tag) Docker Pulls
security Optimized for security 20 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • If this linter is active, all files will always be linted

How the linting is performed

devskim is called once on the whole project directory

  • filtering can not be done using MegaLinter configuration variables,it must be done using devskim configuration or ignore file (if existing)
  • VALIDATE_ALL_CODEBASE: false does not make devskim analyze only updated files

Example calls

devskim analyze .
devskim analyze --file-format sarif .

Installation on mega-linter Docker image

  • Dockerfile commands :
RUN wget --tries=5 -q -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \
    && chmod +x dotnet-install.sh \
    && ./dotnet-install.sh --install-dir /usr/share/dotnet -channel 5.0 -version latest

ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet"
RUN dotnet tool install --global Microsoft.CST.DevSkim.CLI