Skip to content

Commit

Permalink
Add quick start documentation
Browse files Browse the repository at this point in the history
Closes #2256
  • Loading branch information
paul-dingemans committed Sep 17, 2023
1 parent 719c4cb commit 5998f71
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@
- Executable jar
- Allows extension with custom rule sets and reporters

## Quick start

Follow steps below for a quick start with latest ktlint release.

* Step 1: Install with brew
```shell
brew install ktlint
```
See [download and verification from GitHub](https://pinterest.github.io/ktlint/latest/install/cli/#download-and-verification) or [other package managers](https://pinterest.github.io/ktlint/latest/install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](https://pinterest.github.io/ktlint/latest/install/integrations/).

* Step 2: Lint and format your code
All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible.
```shell title="Autocorrect style violations"
ktlint --format
# or
ktlint -F
```
See [cli usage](https://pinterest.github.io/ktlint/latest/install/cli/#command-line-usage) for a more extensive description on using ktlint.

## Documentation

<a href="https://pinterest.github.io/ktlint/">User guide</a>
Expand Down
16 changes: 16 additions & 0 deletions documentation/release-latest/docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Follow steps below for a quick start with latest ktlint release.

## Step 1: Install with brew
```shell
brew install ktlint
```
See [download and verification from GitHub](../install/cli/#download-and-verification) or [other package managers](../install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](../install/integrations/).

## Step 2: Lint and format your code
All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible.
```shell title="Autocorrect style violations"
ktlint --format
# or
ktlint -F
```
See [cli usage](../install/cli/#command-line-usage) for a more extensive description on using ktlint.
4 changes: 3 additions & 1 deletion documentation/release-latest/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ theme:
- search.share

nav:
- Home: index.md
- Home:
- Features: index.md
- Quick start: quick-start.md
- Installation:
- Command line: install/cli.md
- Integrations: install/integrations.md
Expand Down
16 changes: 16 additions & 0 deletions documentation/snapshot/docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Follow steps below for a quick start with latest ktlint release.

## Step 1: Install with brew
```shell
brew install ktlint
```
See [download and verification from GitHub](../install/cli/#download-and-verification) or [other package managers](../install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](../install/integrations/).

## Step 2: Lint and format your code
All files with extension `.kt` and `.kts` in the current directory and below will be scanned. Problems will be fixed automatically when possible.
```shell title="Autocorrect style violations"
ktlint --format
# or
ktlint -F
```
See [cli usage](../install/cli/#command-line-usage) for a more extensive description on using ktlint.
4 changes: 3 additions & 1 deletion documentation/snapshot/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ theme:
- search.share

nav:
- Home: index.md
- Home:
- Features: index.md
- Quick start: quick-start.md
- Installation:
- Command line: install/cli.md
- Integrations: install/integrations.md
Expand Down

0 comments on commit 5998f71

Please sign in to comment.