mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-21 20:22:11 -05:00
Add textlint (#2021)
* Add textlint * Fix by textlint * Fix package-lock.json * Fix package-lock.json
This commit is contained in:
parent
1ecfcd8631
commit
fafdcd214e
15 changed files with 2527 additions and 31 deletions
20
.automation/test/natural_language/README.md
Normal file
20
.automation/test/natural_language/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Natural language Test Cases
|
||||
|
||||
This folder holds the test cases for **natural language**.
|
||||
|
||||
## Additional Docs
|
||||
|
||||
No Additional information is needed for this test case.
|
||||
|
||||
## Good Test Cases
|
||||
|
||||
The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted.
|
||||
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
|
||||
## Bad Test Cases
|
||||
|
||||
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
|
||||
|
||||
- **Note:** They are linted utilizing the default linter rules.
|
||||
{"mode":"full","isActive":false}
|
|
@ -0,0 +1,2 @@
|
|||
My **Javascript** is good
|
||||
Write change logs about source-maps
|
|
@ -0,0 +1,2 @@
|
|||
My **JavaScript** is good
|
||||
Write changelogs about source maps
|
6
.github/linters/.textlintrc
vendored
6
.github/linters/.textlintrc
vendored
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"filters": {},
|
||||
"filters": {
|
||||
"comments": true
|
||||
},
|
||||
"rules": {
|
||||
"no-dead-link": true
|
||||
"terminology": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,9 @@ members of the project's leadership.
|
|||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
<!-- textlint-disable -->
|
||||
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct/)
|
||||
<!-- textlint-enable -->
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
|
|
41
README.md
41
README.md
|
@ -49,7 +49,7 @@ The design of the **Super-Linter** is currently to allow linting to occur in **G
|
|||
|
||||
## Supported Linters
|
||||
|
||||
Developers on **GitHub** can call the **GitHub Action** to lint their code base with the following list of linters:
|
||||
Developers on **GitHub** can call the **GitHub Action** to lint their codebase with the following list of linters:
|
||||
|
||||
| _Language_ | _Linter_ |
|
||||
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
|
@ -64,7 +64,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
|
|||
| **Copy/paste detection** | [jscpd](https://github.com/kucherenko/jscpd) |
|
||||
| **Dart** | [dartanalyzer](https://dart.dev/guides/language/analysis-options) |
|
||||
| **Dockerfile** | [dockerfilelint](https://github.com/replicatedhq/dockerfilelint.git) / [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| **EDITORCONFIG** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) |
|
||||
| **EditorConfig** | [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) |
|
||||
| **ENV** | [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) |
|
||||
| **GitHub Actions** | [actionlint](https://github.com/rhysd/actionlint) |
|
||||
| **Gherkin** | [gherkin-lint](https://github.com/vsiakka/gherkin-lint) |
|
||||
|
@ -72,7 +72,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
|
|||
| **Groovy** | [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) |
|
||||
| **HTML** | [HTMLHint](https://github.com/htmlhint/HTMLHint) |
|
||||
| **Java** | [checkstyle](https://checkstyle.org) / [google-java-format](https://github.com/google/google-java-format) |
|
||||
| **JavaScript** | [eslint](https://eslint.org/) / [standard js](https://standardjs.com/) |
|
||||
| **JavaScript** | [ESLint](https://eslint.org/) / [standard js](https://standardjs.com/) |
|
||||
| **JSON** | [eslint-plugin-json](https://www.npmjs.com/package/eslint-plugin-json) |
|
||||
| **JSONC** | [eslint-plugin-jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc) |
|
||||
| **Kubeval** | [kubeval](https://github.com/instrumenta/kubeval) |
|
||||
|
@ -80,6 +80,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
|
|||
| **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) |
|
||||
| **Lua** | [luacheck](https://github.com/luarocks/luacheck) |
|
||||
| **Markdown** | [markdownlint](https://github.com/igorshubovych/markdownlint-cli#readme) |
|
||||
| **Natural language** | [textlint](https://textlint.github.io/) |
|
||||
| **OpenAPI** | [spectral](https://github.com/stoplightio/spectral) |
|
||||
| **Perl** | [perlcritic](https://metacpan.org/pod/Perl::Critic) |
|
||||
| **PHP** | [PHP built-in linter](https://www.php.net/) / [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) / [PHPStan](https://phpstan.org/) / [Psalm](https://psalm.dev/) |
|
||||
|
@ -97,7 +98,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
|
|||
| **Tekton** | [tekton-lint](https://github.com/IBM/tekton-lint) |
|
||||
| **Terraform** | [tflint](https://github.com/terraform-linters/tflint) / [terrascan](https://github.com/accurics/terrascan) |
|
||||
| **Terragrunt** | [terragrunt](https://github.com/gruntwork-io/terragrunt) |
|
||||
| **TypeScript** | [eslint](https://eslint.org/) / [standard js](https://standardjs.com/) |
|
||||
| **TypeScript** | [ESLint](https://eslint.org/) / [standard js](https://standardjs.com/) |
|
||||
| **XML** | [LibXML](http://xmlsoft.org/) |
|
||||
| **YAML** | [YamlLint](https://github.com/adrienverge/yamllint) |
|
||||
|
||||
|
@ -111,7 +112,7 @@ To use this **GitHub** Action you will need to complete the following:
|
|||
2. Copy the example workflow from below into that new file, no extra configuration required
|
||||
3. Commit that file to a new branch
|
||||
4. Open up a pull request and observe the action working
|
||||
5. Enjoy your more _stable_, and _cleaner_ code base
|
||||
5. Enjoy your more _stable_, and _cleaner_ codebase
|
||||
6. Check out the [Wiki](https://github.com/github/super-linter/wiki) for customization options
|
||||
|
||||
**NOTE:** If you pass the _Environment_ variable `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` in your workflow, then the **GitHub Super-Linter** will mark the status of each individual linter run in the Checks section of a pull request. Without this you will only see the overall status of the full run. There is no need to set the **GitHub** Secret as it is automatically set by GitHub, it only needs to be passed to the action.
|
||||
|
@ -284,18 +285,18 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) |
|
||||
| **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) |
|
||||
| **GITHUB_ACTIONS_CONFIG_FILE** | `actionlint.yml` | Filename for [Actionlint configuration](https://github.com/rhysd/actionlint/blob/main/docs/config.md) (ex: `actionlint.yml`) |
|
||||
| **GITHUB_DOMAIN** | `github.com` | Specify a custom Github domain in case Github Enterprise is used: e.g. `github.myenterprise.com` |
|
||||
| **GITHUB_CUSTOM_API_URL** | `https://api.github.com` | Specify a custom Github API URL in case Github Enterprise is used: e.g. `https://github.myenterprise.com/api/v3` | |
|
||||
| **GITHUB_DOMAIN** | `github.com` | Specify a custom GitHub domain in case GitHub Enterprise is used: e.g. `github.myenterprise.com` |
|
||||
| **GITHUB_CUSTOM_API_URL** | `https://api.github.com` | Specify a custom GitHub API URL in case GitHub Enterprise is used: e.g. `https://github.myenterprise.com/api/v3` | |
|
||||
| **GITLEAKS_CONFIG_FILE** | `.gitleaks.toml` | Filename for [GitLeaks configuration](https://github.com/zricethezav/gitleaks#configuration) (ex: `.geatleaks.toml`) |
|
||||
| **IGNORE_GENERATED_FILES** | `false` | If set to `true`, super-linter will ignore all the files with `@generated` marker but without `@not-generated` marker. |
|
||||
| **IGNORE_GITIGNORED_FILES** | `false` | If set to `true`, super-linter will ignore all the files that are ignored by Git. |
|
||||
| **JAVA_FILE_NAME** | `sun-checks.xml` | Filename for [Checkstyle configuration](https://checkstyle.sourceforge.io/config.html) (ex: `checkstyle.xml`) |
|
||||
| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
|
||||
| **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Flag to set the default style of javascript. Available options: **standard**/**prettier** |
|
||||
| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
|
||||
| **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Flag to set the default style of JavaScript. Available options: **standard**/**prettier** |
|
||||
| **JSCPD_CONFIG_FILE** | `.jscpd.json` | Filename for JSCPD configuration |
|
||||
| **KUBERNETES_KUBEVAL_OPTIONS** | `null` | Additional arguments to pass to the command line when running **Kubernetes Kubeval** (Example: --ignore-missing-schemas) |
|
||||
| **KUBERNETES_KUBEVAL_OPTIONS** | `null` | Additional arguments to pass to the command-line when running **Kubernetes Kubeval** (Example: --ignore-missing-schemas) |
|
||||
| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. |
|
||||
| **LOG_FILE** | `super-linter.log` | The file name for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. |
|
||||
| **LOG_FILE** | `super-linter.log` | The filename for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. |
|
||||
| **LOG_LEVEL** | `VERBOSE` | How much output the script will generate to the console. One of `ERROR`, `WARN`, `NOTICE`, `VERBOSE`, `DEBUG` or `TRACE`. |
|
||||
| **MULTI_STATUS** | `true` | A status API is made for each language that is linted to make visual parsing easier. |
|
||||
| **MARKDOWN_CONFIG_FILE** | `.markdown-lint.yml` | Filename for [Markdownlint configuration](https://github.com/DavidAnson/markdownlint#optionsconfig) (ex: `.markdown-lint.yml`, `.markdownlint.json`, `.markdownlint.yaml`) |
|
||||
|
@ -314,7 +315,8 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **SQL_CONFIG_FILE** | `.sql-config.json` | Filename for [SQL-Lint configuration](https://sql-lint.readthedocs.io/en/latest/files/configuration.html) (ex: `sql-config.json` , `.config.json`) |
|
||||
| **TERRAFORM_TFLINT_CONFIG_FILE** | `.tflint.hcl` | Filename for [tfLint configuration](https://github.com/terraform-linters/tflint) (ex: `.tflint.hcl`) |
|
||||
| **TERRAFORM_TERRASCAN_CONFIG_FILE**| `terrascan.toml` | Filename for [terrascan configuration](https://github.com/accurics/terrascan) (ex: `terrascan.toml`) |
|
||||
| **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
|
||||
| **NATURAL_LANGUAGE_CONFIG_FILE** | `.textlintrc` | Filename for [textlint configuration](https://textlint.github.io/docs/getting-started.html#configuration) (ex: `.textlintrc`) |
|
||||
| **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
|
||||
| **USE_FIND_ALGORITHM** | `false` | By default, we use `git diff` to find all files in the workspace and what has been updated, this would enable the Linux `find` method instead to find all files to lint |
|
||||
| **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. |
|
||||
| **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the Ansible language. |
|
||||
|
@ -331,7 +333,7 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **VALIDATE_DART** | `true` | Flag to enable or disable the linting process of the Dart language. |
|
||||
| **VALIDATE_DOCKERFILE** | `true` | Flag to enable or disable the linting process of the Docker language. |
|
||||
| **VALIDATE_DOCKERFILE_HADOLINT** | `true` | Flag to enable or disable the linting process of the Docker language. |
|
||||
| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the editorconfig. |
|
||||
| **VALIDATE_EDITORCONFIG** | `true` | Flag to enable or disable the linting process with the EditorConfig. |
|
||||
| **VALIDATE_ENV** | `true` | Flag to enable or disable the linting process of the ENV language. |
|
||||
| **VALIDATE_GITHUB_ACTIONS** | `true` | Flag to enable or disable the linting process of the GitHub Actions. |
|
||||
| **VALIDATE_GITLEAKS** | `true` | Flag to enable or disable the linting process of the secrets. |
|
||||
|
@ -341,8 +343,8 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **VALIDATE_GROOVY** | `true` | Flag to enable or disable the linting process of the language. |
|
||||
| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the HTML language. |
|
||||
| **VALIDATE_JAVA** | `true` | Flag to enable or disable the linting process of the Java language. (Utilizing: checkstyle) |
|
||||
| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: eslint) |
|
||||
| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Javascript language. (Utilizing: standard) |
|
||||
| **VALIDATE_JAVASCRIPT_ES** | `true` | Flag to enable or disable the linting process of the JavaScript language. (Utilizing: eslint) |
|
||||
| **VALIDATE_JAVASCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the JavaScript language. (Utilizing: standard) |
|
||||
| **VALIDATE_JSCPD** | `true` | Flag to enable or disable the JSCPD. |
|
||||
| **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the JSON language. |
|
||||
| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: eslint) |
|
||||
|
@ -351,6 +353,7 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **VALIDATE_LATEX** | `true` | Flag to enable or disable the linting process of the LaTeX language. |
|
||||
| **VALIDATE_LUA** | `true` | Flag to enable or disable the linting process of the language. |
|
||||
| **VALIDATE_MARKDOWN** | `true` | Flag to enable or disable the linting process of the Markdown language. |
|
||||
| **VALIDATE_NATURAL_LANGUAGE** | `true` | Flag to enable or disable the linting process of the natural language. |
|
||||
| **VALIDATE_OPENAPI** | `true` | Flag to enable or disable the linting process of the OpenAPI language. |
|
||||
| **VALIDATE_PERL** | `true` | Flag to enable or disable the linting process of the Perl language. |
|
||||
| **VALIDATE_PHP** | `true` | Flag to enable or disable the linting process of the PHP language. (Utilizing: PHP built-in linter) (keep for backward compatibility) |
|
||||
|
@ -383,15 +386,15 @@ But if you wish to select or exclude specific linters, we give you full control
|
|||
| **VALIDATE_TERRAFORM_TERRASCAN** | `true` | Flag to enable or disable the linting process of the Terraform language for security related issues. |
|
||||
| **VALIDATE_TERRAGRUNT** | `true` | Flag to enable or disable the linting process for Terragrunt files. |
|
||||
| **VALIDATE_TSX** | `true` | Flag to enable or disable the linting process for tsx files (Utilizing: eslint) |
|
||||
| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: eslint) |
|
||||
| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) |
|
||||
| **VALIDATE_TYPESCRIPT_ES** | `true` | Flag to enable or disable the linting process of the TypeScript language. (Utilizing: eslint) |
|
||||
| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the TypeScript language. (Utilizing: standard) |
|
||||
| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. |
|
||||
| **VALIDATE_YAML** | `true` | Flag to enable or disable the linting process of the YAML language. |
|
||||
| **YAML_CONFIG_FILE** | `.yaml-lint.yml` | Filename for [Yamllint configuration](https://yamllint.readthedocs.io/en/stable/configuration.html) (ex: `.yaml-lint.yml`, `.yamllint.yml`) |
|
||||
|
||||
### Template rules files
|
||||
|
||||
You can use the **GitHub** **Super-Linter** _with_ or _without_ your own personal rules sets. This allows for greater flexibility for each individual code base. The Template rules all try to follow the standards we believe should be enabled at the basic level.
|
||||
You can use the **GitHub** **Super-Linter** _with_ or _without_ your own personal rules sets. This allows for greater flexibility for each individual codebase. The Template rules all try to follow the standards we believe should be enabled at the basic level.
|
||||
|
||||
- Copy **any** or **all** template rules files from `TEMPLATES/` into the `.github/linters/` directory of your repository, and modify them to suit your needs.
|
||||
- The rules files in [this repository's `TEMPLATE` folder](https://github.com/github/super-linter/tree/main/TEMPLATES) will be used as defaults should any be omitted.
|
||||
|
@ -412,7 +415,7 @@ Examples:
|
|||
|
||||
- Lint only src folder: `FILTER_REGEX_INCLUDE: .*src/.*`
|
||||
- Do not lint files inside test folder: `FILTER_REGEX_EXCLUDE: .*test/.*`
|
||||
- Do not lint javascript files inside test folder: `FILTER_REGEX_EXCLUDE: .*test/.*.js`
|
||||
- Do not lint JavaScript files inside test folder: `FILTER_REGEX_EXCLUDE: .*test/.*.js`
|
||||
|
||||
<!-- This `README.md` has both markers in the text, so it is considered not generated. -->
|
||||
Additionally when `IGNORE_GENERATED_FILES=true`, super-linter
|
||||
|
|
8
TEMPLATES/.textlintrc
Normal file
8
TEMPLATES/.textlintrc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"filters": {
|
||||
"comments": true
|
||||
},
|
||||
"rules": {
|
||||
"terminology": true
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
# TEMPLATES
|
||||
|
||||
The files in this folder are template rules for the linters that will run against your code base. If you choose to copy these to your local repository in the `.github/linters/` directory, they will be used at runtime. If rule files are not present locally, the templates will be used by default.
|
||||
The files in this folder are template rules for the linters that will run against your codebase. If you choose to copy these to your local repository in the `.github/linters/` directory, they will be used at runtime. If rule files are not present locally, the templates will be used by default.
|
||||
|
||||
The file(s) will be parsed at run time on the local branch to load all rules needed to run the **Super-Linter** **GitHub** Action.
|
||||
The file(s) will be parsed at runtime on the local branch to load all rules needed to run the **Super-Linter** **GitHub** Action.
|
||||
The **GitHub** Action will inform the user via the **Checks API** on the status and success of the process.
|
||||
|
|
2449
dependencies/package-lock.json
generated
vendored
2449
dependencies/package-lock.json
generated
vendored
File diff suppressed because it is too large
Load diff
3
dependencies/package.json
vendored
3
dependencies/package.json
vendored
|
@ -39,6 +39,9 @@
|
|||
"stylelint-config-standard": "^22.0.0",
|
||||
"stylelint-scss": "^3.21.0",
|
||||
"tekton-lint": "^0.5.2",
|
||||
"textlint": "^12.0.2",
|
||||
"textlint-filter-rule-comments": "^1.2.2",
|
||||
"textlint-rule-terminology": "^2.1.5",
|
||||
"typescript": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
Linters can often require additional configuration to ensure they work with your codebase and your team's coding style, to avoid flagging false-positives. The **GitHub Super-Linter** has set up some default configurations for each linter which should work reasonably well with common code bases, but many of the linters can be configured to disable certain rules or configure the rules to ignore certain pieces of codes.
|
||||
|
||||
To run with your own configuration for a linter, copy the relevant [`TEMPLATE` configuration file for the linter you are using from this repo](https://github.com/github/super-linter/tree/main/TEMPLATES) into the `.github/linters/` folder in your own repository, and then edit it to modify, disable - or even add - rules and configuration to suit how you want your code checked.
|
||||
To run with your own configuration for a linter, copy the relevant [`TEMPLATE` configuration file for the linter you are using from this repository](https://github.com/github/super-linter/tree/main/TEMPLATES) into the `.github/linters/` folder in your own repository, and then edit it to modify, disable - or even add - rules and configuration to suit how you want your code checked.
|
||||
|
||||
How the changes are made differ for each linter, and also how much the **Github Super-Linter** has decided to change the linter's defaults. So, for some linters (e.g. [pylint for python](https://github.com/github/super-linter/blob/main/TEMPLATES/.python-lint)), there may be a large configuration file. For others (e.g. [stylelint for CSS](https://github.com/github/super-linter/blob/main/TEMPLATES/.stylelintrc.json)) the default configuration file may initially be nearly empty. And for some (e.g. StandardJS) it may not be possible to change configuration at all so there is no Template file.
|
||||
How the changes are made differ for each linter, and also how much the **GitHub Super-Linter** has decided to change the linter's defaults. So, for some linters (e.g. [pylint for python](https://github.com/github/super-linter/blob/main/TEMPLATES/.python-lint)), there may be a large configuration file. For others (e.g. [stylelint for CSS](https://github.com/github/super-linter/blob/main/TEMPLATES/.stylelintrc.json)) the default configuration file may initially be nearly empty. And for some (e.g. StandardJS) it may not be possible to change configuration at all so there is no Template file.
|
||||
|
||||
Where a configuration file exists in your repo, it will be used in preference to the default one in the **GitHub Super-Linter** `TEMPLATES` directory (not in addition to it), and where one doesn't exist the `TEMPLATES` version will be used. So you should copy the complete configuration file you require to change from the `TEMPLATES` directory and not just the lines of config you want to change.
|
||||
|
||||
It is possible to have custom configurations for some linters, and continue to use the default from `TEMPLATES` directory for others, so if you use `Python` and `JavaScript` and only need to tweak the `Python` rules, then you only need to have a custom configuration for _pylint_ and continue to use the default `TEMPLATE` from the main repo for _ESLint_, for example.
|
||||
It is possible to have custom configurations for some linters, and continue to use the default from `TEMPLATES` directory for others, so if you use `Python` and `JavaScript` and only need to tweak the `Python` rules, then you only need to have a custom configuration for _pylint_ and continue to use the default `TEMPLATE` from the main repository for _ESLint_, for example.
|
||||
|
||||
For some linters it is also possible to override rules on a case by case level with directives in your code. Where this is possible we try to note how to do this in the specific linter sections below, but the official linter documentation will likely give more detail on this.
|
||||
|
||||
**NOTE: Please view each linters source and webpage from the [Supported Linters README](https://github.com/github/super-linter#supported-linters) to see additional information on how to configure, disable, or tune additional rules.**
|
||||
**NOTE: Please view each linters source and web page from the [Supported Linters README](https://github.com/github/super-linter#supported-linters) to see additional information on how to configure, disable, or tune additional rules.**
|
||||
|
|
|
@ -35,12 +35,12 @@ You can add as many **Additional** flags as needed, documented in [README.md](..
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
### Run container and gain access to the command line
|
||||
### Run container and gain access to the command-line
|
||||
|
||||
If you need to run the container locally and gain access to its command line, you can run the following command:
|
||||
|
||||
- `docker run -it --entrypoint /bin/bash github/super-linter`
|
||||
- This will drop you in the command line of the docker container for any testing or troubleshooting that may be needed.
|
||||
- This will drop you in the command-line of the docker container for any testing or troubleshooting that may be needed.
|
||||
|
||||
### Found issues
|
||||
|
||||
|
|
|
@ -25,6 +25,6 @@ The above example tells Super-Linter:
|
|||
|
||||
a) Your rules files are located in your repository's root directory using the ``LINTER_RULES_PATH: /`` ENV VAR.
|
||||
|
||||
b) Your eslint and stylelint rules files are named ``.stylelintrc.json`` and ``.eslintrc.json`` using the ``CSS_FILE_NAME: .styelintrc.json`` and ``JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json`` ENV VARS.
|
||||
b) Your ESLint and stylelint rules files are named ``.stylelintrc.json`` and ``.eslintrc.json`` using the ``CSS_FILE_NAME: .styelintrc.json`` and ``JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json`` ENV VARS.
|
||||
|
||||
c) To use ``stylelint`` and ``eslint`` to lint all CSS and JavaScript code using the ``VALIDATE_CSS: true`` and ``VALIDATE_JAVASCRIPT_ES: true`` ENV VARS.
|
||||
|
|
|
@ -578,6 +578,7 @@ function BuildFileList() {
|
|||
# Append the file to the array #
|
||||
################################
|
||||
FILE_ARRAY_MARKDOWN+=("${FILE}")
|
||||
FILE_ARRAY_NATURAL_LANGUAGE+=("${FILE}")
|
||||
|
||||
######################
|
||||
# Get the PHP files #
|
||||
|
|
|
@ -176,6 +176,8 @@ TERRAFORM_TFLINT_FILE_NAME="${TERRAFORM_TFLINT_CONFIG_FILE:-.tflint.hcl}"
|
|||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||
TERRAFORM_TERRASCAN_FILE_NAME="${TERRAFORM_TERRASCAN_CONFIG_FILE:-terrascan.toml}"
|
||||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||
NATURAL_LANGUAGE_FILE_NAME="${NATURAL_LANGUAGE_CONFIG_FILE:-.textlintrc}"
|
||||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||
TSX_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}"
|
||||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||
TYPESCRIPT_ES_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}"
|
||||
|
@ -212,7 +214,7 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CLANG_FORMAT'
|
|||
'DOCKERFILE' 'DOCKERFILE_HADOLINT' 'EDITORCONFIG' 'ENV' 'GITHUB_ACTIONS'
|
||||
'GITLEAKS' 'GHERKIN' 'GO' 'GOOGLE_JAVA_FORMAT' 'GROOVY' 'HTML' 'JAVA'
|
||||
'JAVASCRIPT_ES' "${JAVASCRIPT_STYLE_NAME}" 'JSCPD' 'JSON' 'JSONC' 'JSX'
|
||||
'KUBERNETES_KUBEVAL' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN'
|
||||
'KUBERNETES_KUBEVAL' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN' 'NATURAL_LANGUAGE'
|
||||
'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'PHP_PSALM'
|
||||
'POWERSHELL' 'PROTOBUF' 'PYTHON_BLACK' 'PYTHON_PYLINT' 'PYTHON_FLAKE8'
|
||||
'PYTHON_ISORT' 'PYTHON_MYPY' 'R' 'RAKU' 'RUBY' 'RUST_2015' 'RUST_2018'
|
||||
|
@ -259,6 +261,7 @@ LINTER_NAMES_ARRAY['KUBERNETES_KUBEVAL']="kubeval"
|
|||
LINTER_NAMES_ARRAY['LATEX']="chktex"
|
||||
LINTER_NAMES_ARRAY['LUA']="lua"
|
||||
LINTER_NAMES_ARRAY['MARKDOWN']="markdownlint"
|
||||
LINTER_NAMES_ARRAY['NATURAL_LANGUAGE']="textlint"
|
||||
LINTER_NAMES_ARRAY['OPENAPI']="spectral"
|
||||
LINTER_NAMES_ARRAY['PERL']="perl"
|
||||
LINTER_NAMES_ARRAY['PHP_BUILTIN']="php"
|
||||
|
@ -876,6 +879,7 @@ if [ -n "${MARKDOWN_CUSTOM_RULE_GLOBS}" ]; then
|
|||
fi
|
||||
done
|
||||
fi
|
||||
LINTER_COMMANDS_ARRAY['NATURAL_LANGUAGE']="textlint -c ${NATURAL_LANGUAGE_LINTER_RULES}"
|
||||
LINTER_COMMANDS_ARRAY['OPENAPI']="spectral lint -r ${OPENAPI_LINTER_RULES}"
|
||||
LINTER_COMMANDS_ARRAY['PERL']="perlcritic"
|
||||
LINTER_COMMANDS_ARRAY['PHP_BUILTIN']="php -l -c ${PHP_BUILTIN_LINTER_RULES}"
|
||||
|
|
Loading…
Reference in a new issue