Skip to content
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

Subfolder selene.toml #526

Open
Commandcracker opened this issue May 29, 2023 · 3 comments · May be fixed by #543
Open

Subfolder selene.toml #526

Commandcracker opened this issue May 29, 2023 · 3 comments · May be fixed by #543
Labels
A-bin Area: selene, the program C-enhancement Category: Feature request or improvement

Comments

@Commandcracker
Copy link

Explanation

I would like selen to handle selene.toml's in subfolders.

Example

📦project
 ┣ 📂spec
 ┃ ┣ 📜test_spec.lua -- should use /spec/selene.toml
 ┃ ┣ 📄busted.selene.yaml
 ┃ ┗ ⚙️selene.toml
 ┣ 📂src
 ┃ ┣ 📄cc-tweaked.selene.yaml
 ┃ ┣ 📜test.lua -- should use /src/selene.toml
 ┃ ┗ ⚙️selene.toml
 ┣ 📂some_folder
 ┃ ┗ 📜test.lua -- should use /selene.toml
 ┣ 📜test.lua -- should use /selene.toml
 ┗ ⚙️selene.toml
@Kampfkarren Kampfkarren added C-enhancement Category: Feature request or improvement A-bin Area: selene, the program labels May 29, 2023
@Commandcracker
Copy link
Author

It would also be possible to have the main selene.toml say which std should be used at which folder, at least it would work for my use case but having subfolder selene.toml's might also be a good idea.

@williamboman
Copy link
Contributor

@Commandcracker Somewhat off-topic but did you write busted.selene.yaml yourself? I'm struggling to find a Selene configuration for it and was wondering if you'd like to share it?

@agirardeau
Copy link

agirardeau commented Jun 3, 2024

I have a slightly different feature request that might be combined with this. What I want is an option to find a config file by searching upwards recursively from the directory containing the file I'm linting.

Consider the following directory structure:

foo/
  bar/
    selene.toml
    baz/
      hello.lua

If I run selene against hello.lua from the bar/ directory, the config file is detected, but if I run it from foo/ or baz/, it is not. I'd like it to detect selene.toml no matter where I run selene from.

This is relevant to me because I use selene inside neovim, which runs selene from the directory running neovim.

I could add logic to my neovim config to pass the appropriate --config flag to selene, but that's rather a hassle, and I expect enough others to have the same issue that I think it would be worth implementing this feature.

If I should open a separate issue though let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bin Area: selene, the program C-enhancement Category: Feature request or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants