4306f86a8cb2b2e586477a7cd46e3f66e2d572bb
[webi-installers/.git] / dotenv-linter / README.md
1 ---
2 title: Dotenv Linter
3 homepage: https://dotenv-linter.github.io/
4 tagline: |
5   dotenv-linter: ⚡️ Lightning-fast linter for .env files. Written in Rust 🦀
6 ---
7
8 ### Updating `dotenv-linter`
9
10 `webi dotenv-linter@stable`
11
12 Use the `@beta` tag for pre-releases.
13
14 #### Windows 10
15
16 On Windows 10 you'll get an error like this:
17
18 > execution cannot proceed run because `vcruntime140.dll` was not found
19
20 You need to download and install the
21 [Microsoft Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads).
22
23 ## Cheat Sheet
24
25 > Dotenv Linter is a lightning-fast check for your `.env` files.
26 > It can rapidly detect and automatically fix issues.
27
28 By default, `dotenv-linter` checks all `.env` files in the current directory:
29
30 ```bash
31 dotenv-linter
32 ```
33
34 This is the same as the default behavior:
35
36 ```bash
37 dotenv-linter .env .env.*
38 ```
39
40 To lint .env files recursively, use `-r`:
41
42 ```bash
43 dotenv-linter -r
44 ```
45
46 For the complete usage, see the official [Dotenv Linter Usage Guide](https://dotenv-linter.github.io/#/usage).
47
48 ### How to automatically fix errors
49
50 Use the `--fix` flag.
51
52 ```bash
53 dotenv-linter --fix
54 ```
55
56 Backup files in the format of `.env_0000000000` will be created by default.
57 You can use `--no-backup` to skip this.
58
59 ### How to toggle linter rules
60
61 You can turn off certain linter checks with `--skip` options, for example:
62
63 ```bash
64 dotenv-linter --skip QuoteCharacter --skip UnorderedKey
65 ```
66
67 You can see the full list of linter rules with `dotenv-linter --show-checks`:
68
69 ```txt
70 DuplicatedKey
71 EndingBlankLine
72 ExtraBlankLine
73 IncorrectDelimiter
74 LeadingCharacter
75 KeyWithoutValue
76 LowercaseKey
77 QuoteCharacter
78 SpaceCharacter
79 TrailingWhitespace
80 UnorderedKey
81 ```