From 3ab9a1e9cb72e84c926362b16fb47cd1c39c1c3a Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Wed, 20 Sep 2023 02:49:44 -0700 Subject: [PATCH] docs: config-cli-lint-mode.md: Grammar tweaks (#2953) * docs: config-cli-lint-mode.md: Grammar tweaks * Update config-cli-lint-mode.md per review comments See https://github.com/oxsecurity/megalinter/pull/2953#pullrequestreview-1623467572 * Update README.md * Update README.md Co-authored-by: Kurt von Laven <974910+Kurt-von-Laven@users.noreply.github.com> --- README.md | 18 +++++++++--------- docs/config-cli-lint-mode.md | 19 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index fc1700bac5c..d723cb31681 100644 --- a/README.md +++ b/README.md @@ -1233,22 +1233,22 @@ description: Cli lint mode can be list_of_files, project or files --> ### CLI lint mode -Each linter has a lint mode by default, visible in its MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)): +Each linter is pre-configured to use a default lint mode, which are visible in the MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)). The possible values are: -- `list_of_files`: All files are sent in single call to the linter -- `project`: The linter is called from the root of the project, without specifying any file name -- `file`: The linter is called once by file (so the performances may not be very good) +- `list_of_files`: The linter is called only once, and passed a list of all the files to be processed +- `project`: The linter is called only once, from the root folder of the repository, and it scans for the files to process, as no file names are provided it +- `file`: The linter is called once per file, which hurts performance -You can override the CLI_LINT_MODE by using configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/)) +You can override the CLI_LINT_MODE by using a configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/)). -- Linters with `file` default lint mode can not be overridden to `list_of_files` -- Linters with `project` default lint mode can not be overridden to `list_of_files` or `file` +- Linters that default to the `file` lint mode cannot be overridden to use the `list_of_files` lint mode +- Linters that default to the `project` lint mode cannot be overridden to use either the `list_of_files` or `file` lint modes. -Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds, for example with linters that have a problem to find their config file when the current folder isn't the repo root. +Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds. For example, some linters have a problem finding their config file when the current folder isn't the repository's root folder. Special considerations: -- As list of files isn't sent to the linter command, linters using `project` lint mode don't take in account some variables like FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE. For those linters, you must check their documentation to define ignore configuration as it's awaited by the linter (for example with a `.secretlintignore` file for secretlint) +- Linters that are configured to use the `project` lint mode ignore variables like `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`, as they are not passed a list of files to lint. For those linters, you must check their documentation to see if a linter can be configured to ignore specific files. For example, the [Secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) linter ignore files listed in `~/.secretlintignore` by default, or it can be configured to instead ignore files listed in `~/.gitignore` by setting `REPOSITORY_SECRETLINT_ARGUMENTS` to `--secretlintignore .gitignore.`. diff --git a/docs/config-cli-lint-mode.md b/docs/config-cli-lint-mode.md index c41238aa483..ed5976f2226 100644 --- a/docs/config-cli-lint-mode.md +++ b/docs/config-cli-lint-mode.md @@ -8,22 +8,21 @@ description: Cli lint mode can be list_of_files, project or files # CLI lint mode -Each linter has a lint mode by default, visible in its MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)): +Each linter is pre-configured to use a default lint mode, which are visible in the MegaLinter documentation ([example](https://megalinter.io/latest/descriptors/repository_trivy/#how-the-linting-is-performed)). The possible values are: -- `list_of_files`: All files are sent in single call to the linter -- `project`: The linter is called from the root of the project, without specifying any file name -- `file`: The linter is called once by file (so the performances may not be very good) +- `list_of_files`: The linter is called only once, and passed a list of all the files to be processed +- `project`: The linter is called only once, from the root folder of the repository, and it scans for the files to process, as no file names are provided it +- `file`: The linter is called once per file, which hurts performance -You can override the CLI_LINT_MODE by using configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/)) +You can override the CLI_LINT_MODE by using a configuration variable for each linter (see [linters documentation](https://megalinter.io/supported-linters/)). -- Linters with `file` default lint mode can not be overridden to `list_of_files` -- Linters with `project` default lint mode can not be overridden to `list_of_files` or `file` +- Linters that default to the `file` lint mode cannot be overridden to use the `list_of_files` lint mode +- Linters that default to the `project` lint mode cannot be overridden to use either the `list_of_files` or `file` lint modes. -Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds, for example with linters that have a problem to find their config file when the current folder isn't the repo root. +Allowing `file` or `list_of_files` to be overridden to `project` is mostly for workarounds. For example, some linters have a problem finding their config file when the current folder isn't the repository's root folder. Special considerations: -- As list of files isn't sent to the linter command, linters using `project` lint mode don't take in account some variables like FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE. For those linters, you must check their documentation to define ignore configuration as it's awaited by the linter (for example with a `.secretlintignore` file for secretlint) - +- Linters that are configured to use the `project` lint mode ignore variables like `FILTER_REGEX_INCLUDE` and `FILTER_REGEX_EXCLUDE`, as they are not passed a list of files to lint. For those linters, you must check their documentation to see if a linter can be configured to ignore specific files. For example, the [Secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) linter ignore files listed in `~/.secretlintignore` by default, or it can be configured to instead ignore files listed in `~/.gitignore` by setting `REPOSITORY_SECRETLINT_ARGUMENTS` to `--secretlintignore .gitignore.`.