-
-
Notifications
You must be signed in to change notification settings - Fork 158
Recursive search for .env files
#223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I found #87 issue, it's already discussed, but in fact, I'm not sure what to compare the linter with libraries for load environment variables is correctly (they have different goals). Most of the linters that I know by default work recursively. I will be glad to discuss this and look at it from another perspective. |
|
Like in #87 my mind didn't change. |
|
@DDtKey Thank you! It would be great if we first discussed this feature before its implementation 🙏 I have o lot of projects with Other linters like To use
Or we should use Docker Compose and keep |
Yes, my fault :) But as I wrote above, loading variables is not exactly the same as a linter. In my memory, there were cases when folders were grouped and had other files nested. And they were directly loaded by applications according to completely different scenarios. For example, take In the end, I just do not see a problem in the presence of this function, it allows you to do the same thing, but also complements the feature 🤔 |
|
If this seems like an excess, okay, I will close the PR. |
Usually all $ dotenv-linter ./another-directory .Do you know projects where
I think, ├── src
│ ├── checks
│ │ ├── duplicated_key.rs
│ │ ├── ending_blank_line.rs
│ │ ├── extra_blank_line.rs
│ │ ├── incorrect_delimiter.rs
│ │ ├── key_without_value.rs
│ │ ├── leading_character.rs
│ │ ├── lowercase_key.rs
│ │ ├── quote_character.rs
│ │ ├── space_character.rs
│ │ ├── trailing_whitespace.rs
│ │ └── unordered_key.rs
│ ├── checks.rs
│ ├── common.rs
│ ├── fs_utils.rs
│ ├── lib.rs
│ └── main.rsBut, I haven't seen any projects with similar structure with ├── example.env
├── global.env
├── subdir1
│ ├── common.env
│ └── subdir3
│ └── sample.env
└── subdir2
└── test.env
I see some problems:
|
I think we can add this feature, but only as an additional option. @mstruebing What do you think about it? Or don't we need this feature? |
|
I really saw projects with the following structure : environments
├── config.env
├── module1
│ └── module.env
└── module2
└── module.envBut with a deep level of nesting, probably not, I have not seen. |
Such cases can always be handled with exclude (it works well in the current PR), but yes, we can to turn off recursion by default. |
|
In my experience, like @DDtKey, I have seen many projects with several About the implementation, when recursion is used, will there be any default exclude list ( |
|
I think adding it as an optional feature is okay. So yeah, I agree: optional feature 👍 |
|
@mgrachev Before doing any further actions for an optional feature, I would like to know your opinion. |
|
I agree with @mstruebing. Please, add an additional flag to run recursive search. |
# Conflicts: # CHANGELOG.md # src/lib.rs
Added a flag, updated tests and documentation. Glad to discuss possible codebase improvements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DDtKey Great work! 🚀
I've left some comments. Please, look at them.
|
@mstruebing Please, take a look at these changes 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very clean and understandable to me 👍
I think it is useful that the linter can search for all
envfiles in the specified directory, including the subdirectories.This does not prevent specifying specific files and directories input, as well as excluding them.
What do you think?
✔ Checklist: