selene
selene copied to clipboard
Attempt to find `selene.toml` in parent directories
With this change, if the --config flag is not specified, selene will search the current directory and all parent directories for a selene.toml file, rather than only looking in the current directory.
This does not affect standard library file resolution - it is assumed that the standard library file is in the same directory as the config file.
Closes #526.
This behavior should be added to docs. This is good, but this serves a different use case than #526.
I’m concerned about the case if the user accidentally adds a selene.toml in some ancestor directory, it may be difficult to debug why selene is not behaving in the way they expect. Should it output a message that it’s getting the config file in an ancestor directory?
I’m concerned about the case if the user accidentally adds a
selene.tomlin some ancestor directory, it may be difficult to debug why selene is not behaving in the way they expect. Should it output a message that it’s getting the config file in an ancestor directory?
I don't think this will be a problem - many other linters/formatters work the same way when locating their config files. If we're concerned for backwards compatibility, though, we could make this a --parent-config (name not final) command line flag.
If we're concerned for backwards compatibility, though, we could make this a
--parent-config(name not final) command line flag.
My intuition says such cases where a config file exists somewhere higher but the user relies on default config values is much more likely locally (which an output would make it obvious why it's behaving differently) than in a controlled ci environment.
But at the very least document this behavior and link the pr to a relevant issue (not #526).
still not merged? I use ale for linting,but the neovim always change current dir when open directory. So I really need the feature.