diff --git a/.automation/generated/linter-links-previews.json b/.automation/generated/linter-links-previews.json index e885a19fc4f..c62dff12d87 100644 --- a/.automation/generated/linter-links-previews.json +++ b/.automation/generated/linter-links-previews.json @@ -260,9 +260,9 @@ "title": "instrumenta/kubeval" }, "lightning-flow-scanner": { - "description": "Lightning-Flow-Scanner has 5 repositories available. Follow their code on GitHub.", + "description": "A Salesforce CLI Plugin designed to proactively enforce secure and maintainable Salesforce Flows. It detects unsafe running contexts, hardcoded IDs, unhandled nulls, inefficient database operations and more, helping teams ensure their automations are safe and reliable..", "image": "https://avatars.githubusercontent.com/u/148573214?s=280&v=4", - "title": "Lightning-Flow-Scanner" + "title": "Flow-Scanner" }, "lintr": { "description": "Static Code Analysis for R. Contribute to r-lib/lintr development by creating an account on GitHub.", diff --git a/.automation/generated/linter-versions.json b/.automation/generated/linter-versions.json index 54731c2157e..5bd385d5932 100644 --- a/.automation/generated/linter-versions.json +++ b/.automation/generated/linter-versions.json @@ -50,7 +50,7 @@ "kubeconform": "0.7.0", "kubescape": "3.0.41", "kubeval": "0.16.1", - "lightning-flow-scanner": "3.29.0", + "lightning-flow-scanner-cli": "3.29.0", "lintr": "0.0.0", "ls-lint": "2.3.1", "luacheck": "1.2.0", diff --git a/.automation/generated/linters_matrix.json b/.automation/generated/linters_matrix.json index df47d3ce0fc..c05f6bcde52 100644 --- a/.automation/generated/linters_matrix.json +++ b/.automation/generated/linters_matrix.json @@ -96,6 +96,7 @@ "salesforce_sfdx_scanner_apex", "salesforce_sfdx_scanner_aura", "salesforce_sfdx_scanner_lwc", + "salesforce_lightning_flow_scanner", "scala_scalafix", "snakemake_lint", "snakemake_snakefmt", diff --git a/Dockerfile b/Dockerfile index b6f44e3dabe..40da52b801a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -336,6 +336,8 @@ ARG GEM_RUBOCOP_RAKE_VERSION=0.7.1 ARG GEM_RUBOCOP_RSPEC_VERSION=3.7.0 # renovate: datasource=npm depName=@salesforce/sfdx-scanner ARG SALESFORCE_SFDX_SCANNER_VERSION=4.12.0 +# renovate: datasource=npm depName=lightning-flow-scanner +ARG LIGHTNING_FLOW_SCANNER_VERSION=5.6.2 # renovate: datasource=pypi depName=snakemake ARG PIP_SNAKEMAKE_VERSION=9.11.6 # renovate: datasource=pypi depName=snakefmt @@ -1111,6 +1113,13 @@ RUN curl -sSfL https://raw.githubusercontent.com/anchore/syft/refs/tags/v${REPOS # RUN sf plugins install @salesforce/sfdx-scanner@${SALESFORCE_SFDX_SCANNER_VERSION} \ # && (npm cache clean --force || true) \ # && rm -rf /root/.npm/_cacache +# +# lightning-flow-scanner installation + + && echo y|sf plugins install lightning-flow-scanner@${LIGHTNING_FLOW_SCANNER_VERSION} \ + && (npm cache clean --force || true) \ + && rm -rf /root/.npm/_cacache \ + # # scalafix installation && ./coursier install scalafix --quiet --install-dir /usr/bin && rm -rf /root/.cache \ diff --git a/docs/descriptors/salesforce_lightning_flow_scanner.md b/docs/descriptors/salesforce_lightning_flow_scanner.md index b8ab189287b..07bcff8f337 100644 --- a/docs/descriptors/salesforce_lightning_flow_scanner.md +++ b/docs/descriptors/salesforce_lightning_flow_scanner.md @@ -3,21 +3,18 @@ title: lightning-flow-scanner configuration in MegaLinter description: How to use lightning-flow-scanner (configure, ignore files, ignore errors, help & version documentations) to analyze SALESFORCE files --- +
- - lightning-flow-scanner + + lightning-flow-scanner
-![disabled](https://shields.io/badge/-disabled-orange) [![GitHub stars](https://img.shields.io/github/stars/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx?cacheSeconds=3600)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx?sort=semver)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx/commits) [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx/graphs/commit-activity/) [![GitHub contributors](https://img.shields.io/github/contributors/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx/graphs/contributors/) - -_This linter has been disabled in this version_ +![disabled](https://shields.io/badge/-disabled-orange) [![GitHub stars](https://img.shields.io/github/stars/Flow-Scanner/lightning-flow-scanner-cli?cacheSeconds=3600)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Flow-Scanner/lightning-flow-scanner-cli?sort=semver)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/Flow-Scanner/lightning-flow-scanner-cli)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli/commits) [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/Flow-Scanner/lightning-flow-scanner-cli)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli/graphs/commit-activity/) [![GitHub contributors](https://img.shields.io/github/contributors/Flow-Scanner/lightning-flow-scanner-cli)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli/graphs/contributors/) -_Disabled reason: Repo archived -> _ - -**Lightning Flow Scanner** is a specialized SFDX plugin that analyzes Salesforce Flows for integrity issues, performance problems, and adherence to best practices. It helps developers build reliable and maintainable Flow automations. +A Salesforce CLI Plugin designed to proactively enforce secure and maintainable Salesforce Flows. It detects unsafe running contexts, hardcoded IDs, unhandled nulls, inefficient database operations and more, helping teams ensure their automations are safe and reliable. **Key Features:** @@ -35,49 +32,49 @@ If your root folder is not **force-app**, please set variable SALESFORCE_LIGHTNI ## lightning-flow-scanner documentation -- Version in MegaLinter: **3.29.0** -- Visit [Official Web Site](https://github.com/Lightning-Flow-Scanner#readme){target=_blank} -- See [How to configure lightning-flow-scanner rules](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx#configuration){target=_blank} +- Version in MegaLinter: **5.6.2** +- Visit [Official Web Site](https://flow-scanner.github.io/lightning-flow-scanner-cli/){target=_blank} +- See [How to configure lightning-flow-scanner rules](https://github.com/Flow-Scanner/lightning-flow-scanner-cli#configuration){target=_blank} - If custom `.flow-scanner.json` config file isn't found, [.flow-scanner.json](https://github.com/oxsecurity/megalinter/tree/main/TEMPLATES/.flow-scanner.json){target=_blank} will be used -- See [Index of problems detected by lightning-flow-scanner](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core#rules){target=_blank} +- See [Index of problems detected by lightning-flow-scanner](https://github.com/Flow-Scanner/lightning-flow-scanner-core#default-rules){target=_blank} -[![lightning-flow-scanner-sfdx - GitHub](https://gh-card.dev/repos/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx.svg?fullname=)](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx){target=_blank} +[![lightning-flow-scanner-sfdx - GitHub](https://gh-card.dev/repos/Flow-Scanner/lightning-flow-scanner-cli.svg?fullname=)](https://github.com/Flow-Scanner/lightning-flow-scanner-cli){target=_blank} ## Configuration in MegaLinter - Enable lightning-flow-scanner by adding `SALESFORCE_LIGHTNING_FLOW_SCANNER` in [ENABLE_LINTERS variable](https://megalinter.io/beta/configuration/#activation-and-deactivation) - Disable lightning-flow-scanner by adding `SALESFORCE_LIGHTNING_FLOW_SCANNER` in [DISABLE_LINTERS variable](https://megalinter.io/beta/configuration/#activation-and-deactivation) -| Variable | Description | Default value | -|---------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------| -| SALESFORCE_LIGHTNING_FLOW_SCANNER_ARGUMENTS | User custom arguments to add in linter CLI call
Ex: `-s --foo "bar"` | | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter
Ex: `-s --foo "bar"` | | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_CLI_LINT_MODE | Override default CLI lint mode
⚠️ As default value is **project**, overriding might not work
- `file`: Calls the linter for each file
- `list_of_files`: Call the linter with the list of files as argument
- `project`: Call the linter from the root of the project | `project` | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_PRE_COMMANDS | List of bash commands to run before the linter | None | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_POST_COMMANDS | List of bash commands to run after the linter | None | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_UNSECURED_ENV_VARIABLES | List of env variables explicitly not filtered before calling SALESFORCE_LIGHTNING_FLOW_SCANNER and its pre/post commands | None | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_CONFIG_FILE | lightning-flow-scanner configuration file name
Use `LINTER_DEFAULT` to let the linter find it | `.flow-scanner.json` | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_DISABLE_ERRORS | Run linter but consider errors as warnings | `false` | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | `0` | -| SALESFORCE_LIGHTNING_FLOW_SCANNER_CLI_EXECUTABLE | Override CLI executable | `['sf']` | -| SALESFORCE_DIRECTORY | Directory containing SALESFORCE files (use `any` to always activate the linter) | `force-app` | +| Variable | Description | Default value | +| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_ARGUMENTS | User custom arguments to add in linter CLI call``Ex:`-s --foo "bar"` | | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter``Ex:`-s --foo "bar"` | | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_CLI_LINT_MODE | Override default CLI lint mode ``⚠️ As default value is **project**, overriding might not work``- `file`: Calls the linter for each file ``- `list_of_files`: Call the linter with the list of files as argument``- `project`: Call the linter from the root of the project | `project` | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_PRE_COMMANDS | List of bash commands to run before the linter | None | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_POST_COMMANDS | List of bash commands to run after the linter | None | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_UNSECURED_ENV_VARIABLES | List of env variables explicitly not filtered before calling SALESFORCE_LIGHTNING_FLOW_SCANNER and its pre/post commands | None | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_CONFIG_FILE | lightning-flow-scanner configuration file name `
`Use `LINTER_DEFAULT` to let the linter find it | `.flow-scanner.json` | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_RULES_PATH | Path where to find linter configuration file | Workspace folder, then MegaLinter default rules | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_DISABLE_ERRORS | Run linter but consider errors as warnings | `false` | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | `0` | +| SALESFORCE_LIGHTNING_FLOW_SCANNER_CLI_EXECUTABLE | Override CLI executable | `['sf']` | +| SALESFORCE_DIRECTORY | Directory containing SALESFORCE files (use `any` to always activate the linter) | `force-app` | ## IDE Integration Use lightning-flow-scanner in your favorite IDE to catch errors before MegaLinter ! -| | IDE | Extension Name | Install | -|:-------------------------------------------------------------------------------------------------------------------------------------------:|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| | [Visual Studio Code](https://code.visualstudio.com/) | [Lightning Flow Scanner](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner) | [![Install in VSCode](https://github.com/oxsecurity/megalinter/raw/main/docs/assets/images/btn_install_vscode.png)](vscode:extension/ForceConfigControl.lightningflowscanner){target=_blank} | +| `` | IDE | Extension Name | Install | +| :---------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| `` | [Visual Studio Code](https://code.visualstudio.com/) | [Lightning Flow Scanner](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightning-flow-scanner-vsx) | [![Install in VSCode](https://github.com/oxsecurity/megalinter/raw/main/docs/assets/images/btn_install_vscode.png)](vscode:extension/ForceConfigControl.lightning-flow-scanner-vsx){target=_blank} | ## MegaLinter Flavors This linter is available in the following flavors -| | Flavor | Description | Embedded linters | Info | -|:--------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------|:--------------------------|:----------------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| | [all](https://megalinter.io/beta/supported-linters/) | Default MegaLinter Flavor | 127 | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter/beta) ![Docker Pulls](https://img.shields.io/docker/pulls/oxsecurity/megalinter) | +| `` | Flavor | Description | Embedded linters | Info | +| :----------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------ | :------------------------ | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| `` | [all](https://megalinter.io/beta/supported-linters/) | Default MegaLinter Flavor | 127 | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter/beta) ![Docker Pulls](https://img.shields.io/docker/pulls/oxsecurity/megalinter) | ## Behind the scenes @@ -87,7 +84,9 @@ This linter is available in the following flavors - If this linter is active, all files will always be linted + + ### How the linting is performed lightning-flow-scanner is called once on the whole project directory (`project` CLI lint mode) @@ -101,7 +100,6 @@ lightning-flow-scanner is called once on the whole project directory (`project` sf flow:scan ``` - ### Help content ```shell @@ -134,6 +132,7 @@ GLOBAL FLAGS ### Installation on mega-linter Docker image - Dockerfile commands : + ```dockerfile # Parent descriptor install # renovate: datasource=npm depName=@salesforce/cli @@ -151,9 +150,8 @@ RUN sf plugins install @salesforce/plugin-packaging@${NPM_SALESFORCE_PLUGIN_PACK ENV SF_AUTOUPDATE_DISABLE=true SF_CLI_DISABLE_AUTOUPDATE=true # Linter install # renovate: datasource=npm depName=lightning-flow-scanner -ARG LIGHTNING_FLOW_SCANNER_VERSION=5.2.0 +ARG LIGHTNING_FLOW_SCANNER_VERSION=5.6.2 RUN echo y|sf plugins install lightning-flow-scanner@${LIGHTNING_FLOW_SCANNER_VERSION} \ && (npm cache clean --force || true) \ && rm -rf /root/.npm/_cacache ``` - diff --git a/flavors/salesforce/flavor.json b/flavors/salesforce/flavor.json index 206257c6744..c6786ad6592 100644 --- a/flavors/salesforce/flavor.json +++ b/flavors/salesforce/flavor.json @@ -46,6 +46,7 @@ "SALESFORCE_SFDX_SCANNER_APEX", "SALESFORCE_SFDX_SCANNER_AURA", "SALESFORCE_SFDX_SCANNER_LWC", + "SALESFORCE_LIGHTNING_FLOW_SCANNER", "SNAKEMAKE_LINT", "SNAKEMAKE_SNAKEFMT", "SPELL_CSPELL", diff --git a/linters/salesforce_lightning_flow_scanner/Dockerfile b/linters/salesforce_lightning_flow_scanner/Dockerfile index 8a2ae24b69b..27980475976 100644 --- a/linters/salesforce_lightning_flow_scanner/Dockerfile +++ b/linters/salesforce_lightning_flow_scanner/Dockerfile @@ -55,7 +55,7 @@ ARG NPM_SALESFORCE_PLUGIN_PACKAGING_VERSION=2.20.5 # renovate: datasource=npm depName=sfdx-hardis ARG SFDX_HARDIS_VERSION=6.5.4 # renovate: datasource=npm depName=lightning-flow-scanner -ARG LIGHTNING_FLOW_SCANNER_VERSION=5.2.0 +ARG LIGHTNING_FLOW_SCANNER_VERSION=5.6.2 #ARG__END #################### diff --git a/megalinter/descriptors/all_flavors.json b/megalinter/descriptors/all_flavors.json index 5d4792d8c78..ea0e45a5076 100644 --- a/megalinter/descriptors/all_flavors.json +++ b/megalinter/descriptors/all_flavors.json @@ -935,6 +935,7 @@ "SALESFORCE_SFDX_SCANNER_APEX", "SALESFORCE_SFDX_SCANNER_AURA", "SALESFORCE_SFDX_SCANNER_LWC", + "SALESFORCE_LIGHTNING_FLOW_SCANNER", "SNAKEMAKE_LINT", "SNAKEMAKE_SNAKEFMT", "SPELL_CSPELL", diff --git a/megalinter/descriptors/salesforce.megalinter-descriptor.yml b/megalinter/descriptors/salesforce.megalinter-descriptor.yml index 3f2e7d1d4cd..cec7d1006aa 100644 --- a/megalinter/descriptors/salesforce.megalinter-descriptor.yml +++ b/megalinter/descriptors/salesforce.megalinter-descriptor.yml @@ -267,11 +267,9 @@ linters: # Lightning Flow Scanner - linter_name: lightning-flow-scanner - disabled: true - disabled_reason: Repo archived -> https://github.com/Lightning-Flow-Scanner files_sub_directory: force-app linter_text: | - **Lightning Flow Scanner** is a specialized SFDX plugin that analyzes Salesforce Flows for integrity issues, performance problems, and adherence to best practices. It helps developers build reliable and maintainable Flow automations. + **Lightning Flow Scanner** A Salesforce CLI Plugin designed to proactively enforce secure and maintainable Salesforce Flows. It detects unsafe running contexts, hardcoded IDs, unhandled nulls, inefficient database operations and more, helping teams ensure their automations are safe and reliable. **Key Features:** @@ -286,10 +284,10 @@ linters: - **SFDX Native**: Built as a native SFDX plugin for consistent Salesforce toolchain integration If your root folder is not **force-app**, please set variable SALESFORCE_LIGHTNING_FLOW_SCANNER_DIRECTORY - linter_url: https://github.com/Lightning-Flow-Scanner + linter_url: https://flow-scanner.github.io/lightning-flow-scanner-cli/ linter_repo: https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx linter_rules_url: https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core#rules - linter_banner_image_url: https://raw.githubusercontent.com/Lightning-Flow-Scanner/.github/main/docs/images/bannerslim.png + linter_banner_image_url: https://raw.githubusercontent.com/Flow-Scanner/lightning-flow-scanner-cli/main/docs/images/banner.png linter_rules_configuration_url: https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx#configuration linter_spdx_license: AGPL-3.0 config_file_name: .flow-scanner.json @@ -313,7 +311,7 @@ linters: dockerfile: - |- # renovate: datasource=npm depName=lightning-flow-scanner - ARG LIGHTNING_FLOW_SCANNER_VERSION=5.2.0 + ARG LIGHTNING_FLOW_SCANNER_VERSION=5.6.2 - |- RUN echo y|sf plugins install lightning-flow-scanner@${LIGHTNING_FLOW_SCANNER_VERSION} \ && (npm cache clean --force || true) \ @@ -321,4 +319,4 @@ linters: ide: vscode: - name: Lightning Flow Scanner - url: https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner + url: https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightning-flow-scanner-vsx