Skip to content

Commit

Permalink
Updated refs to latest (1.0.1) release (#2311)
Browse files Browse the repository at this point in the history
Co-authored-by: Ktlint Release Workflow <>
  • Loading branch information
paul-dingemans authored Oct 13, 2023
1 parent 3e55920 commit c2ea541
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 172 deletions.
5 changes: 0 additions & 5 deletions documentation/release-latest/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ As of Ktlint 0.50, an error can only be suppressed using @Suppress or @SuppressW
import foo.*
```

## How do I globally disable a rule without `.editorconfig`?

When using Ktlint CLI, you may pass a list of disabled rules via the `--disabled_rules` command line flag. The value is a comma separated list of rule id's that have to be disabled. The rule id must be fully qualified (e.g. must be prefixed with the rule set id).


## Why is `.editorconfig` property `disabled_rules` deprecated and how do I resolve this?

The `.editorconfig` properties `disabled_rules` and `ktlint_disabled_rules` are deprecated as of KtLint version `0.48` and are removed in version `0.49`. Those properties contain a comma separated list of rules which are disabled. Using a comma separated list of values has some disadvantages.
Expand Down
22 changes: 7 additions & 15 deletions documentation/release-latest/docs/install/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All releases of `ktlint` can be downloaded from the [releases](https://github.co
A particular version of `ktlint` can be downloaded with next command which also changes the file to an executable in directory `/usr/local/bin`:

```sh title="Download"
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
```

!!! tip "Curl not installed or behind proxy"
Expand Down Expand Up @@ -59,20 +59,14 @@ On Arch Linux install package [ktlint <sup>AUR</sup>](https://aur.archlinux.org/

### Rule set(s)

When no arguments are specified, the style of all Kotlin files (ending with '.kt' or '.kts') inside the current dir (recursively) are validated with the (non-experimental) rules from the [standard ruleset](../../rules/standard/). Hidden folders will be skipped.
When no arguments are specified, the style of all Kotlin files (ending with '.kt' or '.kts') inside the current dir (recursively) are validated with the rules from the [standard ruleset](../../rules/standard/). Hidden folders will be skipped.

```shell title="Default validation with standard ruleset"
ktlint
```

To validate with the [standard ruleset](../../rules/standard/) including the experimental rules run command below:

```shell title="Validation with standard ruleset including the experimental rules"
ktlint --experimental
```

!!! note
Instead of using this command line flag, it is advised to set `.editorconfig` property `ktlint_experimental = enabled` if you want the project always to be checked with the experimental rules.
The experimental rules in the standard rule set will only be run when `.editorconfig` property `ktlint_experimental = enabled` is set.

To validate with a [custom ruleset](../../api/custom-rule-set/) run command below:

Expand All @@ -83,7 +77,7 @@ ktlint -R /path/to/custom-ruleset.jar
```

!!! note
If the custom rule set contains rules that are marked as experimental, those rule will only be run when `.editorconfig` property `ktlint_experimental = enabled` is set (or command line parameter `--experimental` is specified).
If the custom rule set contains rules that are marked as experimental, those rule will only be run when `.editorconfig` property `ktlint_experimental = enabled` is set.

### Format (autocorrect)

Expand Down Expand Up @@ -149,9 +143,9 @@ A scaffold of the `.editorconfig file` can be generated with command below. Note
```shell title="Generate .editorconfig"
ktlint generateEditorConfig
# or
ktlint --experimental generateEditorConfig
ktlint generateEditorConfig
# or
ktlint --experimental --ruleset=/path/to/custom-ruleset.jar generateEditorConfig
ktlint --ruleset=/path/to/custom-ruleset.jar generateEditorConfig
```

Normally this file is located in the root of your project directory. In case the file is located in a sub folder of the project, the settings of that file only applies to that subdirectory and its folders (recursively). Ktlint automatically detects and reads all `.editorconfig` files in your project.
Expand Down Expand Up @@ -200,8 +194,6 @@ ktlint installGitPrePushHook

`--color` and `--color-name=<colorName>`: Make output colorful and optionally set the color name to use.

`--disabled_rules=<disabledRules>`: A comma-separated list of rules to globally disable. To disable the standard ktlint rule-set use `--disabled_rules=standard`. This flag is most likely to be removed in a future version. Use [`.editorconfig disabled_rules`](../../rules/configuration-ktlint/#disabled-rules).

`-h` or `--help`: Prints help information.

`--limit=<limit>`: Maximum number of errors to show (default: show all)
Expand All @@ -218,6 +210,6 @@ Options `--stdin` and `--patterns-from-stdin` are mutually exclusive, only one o

Microsoft Windows is not able to run the `ktlint` command directly. Ktlint can be run in following ways on Microsoft Windows:

1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.0.0). Add the batch file to your `%PATH%` environment variable for easy access
1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.0.1). Add the batch file to your `%PATH%` environment variable for easy access
2. Run `ktlint` using Git Bash
3. Run as `java -jar ktlint`
6 changes: 3 additions & 3 deletions documentation/release-latest/docs/install/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`.
<dependency>
<groupId>com.pinterest.ktlint</groupId>
<artifactId>ktlint-cli</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
Expand Down Expand Up @@ -117,7 +117,7 @@ configurations {
}
dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
Expand Down Expand Up @@ -167,7 +167,7 @@ The configuration below, defines following task:
val ktlint by configurations.creating

dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
Expand Down
Loading

0 comments on commit c2ea541

Please sign in to comment.