11# ✅ Check
22
3- By default, ` dotenv-linter ` checks all ` .env ` files in the current directory:
3+ ` dotenv-linter ` can check all ` .env ` files in a directory:
44
55``` bash
6- $ dotenv-linter
6+ $ dotenv-linter check .
77Checking .env
88.env:2 DuplicatedKey: The FOO key is duplicated
99.env:3 UnorderedKey: The BAR key should go before the FOO key
@@ -17,7 +17,7 @@ Found 3 problems
1717To check another directory, just pass its path as an argument. The same approach works if you need to check any files individually:
1818
1919``` bash
20- $ dotenv-linter dir1 dir2/.my-env-file
20+ $ dotenv-linter check dir1 dir2/.my-env-file
2121Checking dir1/.env
2222dir1/.env:1 LeadingCharacter: Invalid leading character detected
2323dir1/.env:3 IncorrectDelimiter: The FOO-BAR key has incorrect delimiter
@@ -33,7 +33,7 @@ Found 3 problems
3333If you need to exclude a file from check, you can use the ` --exclude FILE_PATH ` argument (or its short version ` -e ` ):
3434
3535``` bash
36- $ dotenv-linter --exclude .env.test
36+ $ dotenv-linter check --exclude .env.test .
3737Checking .env
3838.env:2 DuplicatedKey: The FOO key is duplicated
3939.env:3 UnorderedKey: The BAR key should go before the FOO key
@@ -46,7 +46,7 @@ Found 2 problems
4646If you need a recursive search inside directories (deeper than 1 level), you can use the ` --recursive ` argument (or its short version ` -r ` ):
4747
4848``` bash
49- $ dotenv-linter --recursive
49+ $ dotenv-linter check --recursive .
5050Checking .env
5151Checking dir1/.env
5252dir1/.env:2 DuplicatedKey: The FOO key is duplicated
@@ -57,12 +57,12 @@ dir2/subdir/.env:3 IncorrectDelimiter: The FOO-BAR key has incorrect delimiter
5757Found 2 problems
5858```
5959
60- #### Skip checks
60+ #### Ignore checks
6161
62- If you need to skip some checks, you can use the ` --skip CHECK_NAME ` argument (or its short version ` -s ` ):
62+ If you need to ignore some checks, you can use the ` --ignore-checks CHECK_NAME ` argument (or its short version ` -i ` ):
6363
6464``` bash
65- $ dotenv-linter --skip UnorderedKey EndingBlankLine
65+ $ dotenv-linter check --ignore-checks UnorderedKey, EndingBlankLine .
6666Checking .env
6767.env:2 DuplicatedKey: The FOO key is duplicated
6868
@@ -87,18 +87,18 @@ BAR=FOO
8787If you want to see only warnings without additional information, use the ` --quiet ` argument (or its short version ` -q ` ):
8888
8989``` bash
90- $ dotenv-linter --quiet
90+ $ dotenv-linter check --quiet .
9191.env:2 DuplicatedKey: The FOO key is duplicated
9292.env:3 UnorderedKey: The BAR key should go before the FOO key
9393.env.test:1 LeadingCharacter: Invalid leading character detected
9494```
9595
9696#### Disable colored output
9797
98- By default, the output is colored. If you want to disable colored output, you can use the ` --no-color ` argument:
98+ By default, the output is colored. If you want to disable colored output, you can use the ` --plain ` argument:
9999
100100``` bash
101- $ dotenv-linter --no-color
101+ $ dotenv-linter check --plain .
102102.env:2 DuplicatedKey: The FOO key is duplicated
103103.env:3 UnorderedKey: The BAR key should go before the FOO key
104104.env.test:1 LeadingCharacter: Invalid leading character detected
@@ -112,7 +112,7 @@ By default, `dotenv-linter` checks for a new version once a day.
112112If the new version is available, it will display information about it:
113113
114114``` bash
115- $ dotenv-linter
115+ $ dotenv-linter check .
116116.env:2 DuplicatedKey: The FOO key is duplicated
117117.env:3 UnorderedKey: The BAR key should go before the FOO key
118118.env.test:1 LeadingCharacter: Invalid leading character detected
@@ -123,7 +123,7 @@ A new release of dotenv-linter is available: v3.1.0 -> v3.1.1
123123https://github.com/dotenv-linter/dotenv-linter/releases/tag/v3.1.1
124124```
125125
126- If you want to disable checking for updates, you can use the ` --not-check -updates ` argument.
126+ If you want to disable checking for updates, you can use the ` --skip -updates ` argument.
127127
128128#### Export prefix
129129
@@ -133,3 +133,17 @@ It is possible to use `export` prefix for defined variables. For example, `expor
133133
134134Some tools use ` .env ` file names but content of these files is not what ` dotenv-linter ` expects.<br />
135135Currently ` dotenv-linter ` doesn't check ` .envrc ` files because [ direnv] ( https://direnv.net ) uses them as bash scripts.
136+
137+ #### Environment variables
138+
139+ Some settings can be controlled via environment variables.
140+
141+ * ` DOTENV_LINTER_IGNORE_CHECKS ` - disables checks (multiple checks are specified separated by commas):
142+ ``` bash
143+ $ DOTENV_LINTER_IGNORE_CHECKS=QuoteCharacter dotenv-linter check .
144+ ```
145+
146+ * ` DOTENV_LINTER_SKIP_UPDATES ` - disables checking for updates:
147+ ``` bash
148+ $ DOTENV_LINTER_SKIP_UPDATES=true dotenv-linter check .
149+ ```
0 commit comments