lint - Demisto SDK Guide - Cortex - Security Operations

Demisto SDK Guide

Creation date
2023-08-01
Last date published
2024-04-01
Category
Demisto SDK Guide
Abstract

The lint command runs several linting libraries to validate code.

Verifies your .py and .ps1 files are up to Cortex standards, including code linting/valid unit tests in the Docker image that the integration uses. This command runs several linting libraries to validate your code, including:

  • Flake8 - Verifies your code is up to PEP8 standards with package in host checks.

  • MyPy - Validates type annotations, assignments and performs additional Python checks with package in host checks.

  • Vulture - Finds unused code with package in host checks.

  • Bandit - Finds security issues with package in host checks.

  • XSOAR Linter - An internal linter used to identify specific restrictions and provide best practice advice for your code.

  • Pylint and Pytest - Used to run your attached unit test (in the _test.py) file on the integration/script's Docker and reports your code coverage with package in Docker image checks.

  • PowerShell test and analyze - Code linters for PowerShell with package in Docker image checks.

After the command runs, a short report appears with all of the error and warnings found, as well as failed and passed unit tests.