selene icon indicating copy to clipboard operation
selene copied to clipboard

Selene should search for configuration files that begin with a dot

Open tomodachi94 opened this issue 2 years ago • 12 comments

Selene should allow prefixing all of its configuration with a dot. StyLua allows this.

This would aid with having developer tooling configurations being distinguished from ordinary source files.

tomodachi94 avatar Dec 08 '22 02:12 tomodachi94

For example, I would have a file, .selene.toml, that contains the same things as selene.toml. In addition, I would have a .my-custom-stdlib.yaml file that contains my custom standard library. In my selene.toml, I would source it as my-custom-stdlib.

tomodachi94 avatar Dec 08 '22 02:12 tomodachi94

Workaround: Specify the --config option when running selene, and prefix your std with a dot.

tomodachi94 avatar Dec 08 '22 03:12 tomodachi94

.selene.toml seems fine, but I think standard libraries should just work with putting the dot in the std name itself, we already have a bunch of weird combinatorics with them

Kampfkarren avatar Dec 17 '22 03:12 Kampfkarren

This is a convention of most formaters/linters. It would be very desireable.

Zeioth avatar Mar 07 '24 01:03 Zeioth

Is there a stronger motivation for this? Introducing multiple ways to do the same thing is not great, and eslint is moving away from such behavior.

chriscerie avatar Mar 18 '24 18:03 chriscerie

eslint is moving away from such behavior.

ESLint is moving away from their old config format entirely. It's not really about prefixing with a ., which is usually just to treat the config as a hidden file.

LastTalon avatar Mar 19 '24 21:03 LastTalon

eslint is moving away from such behavior.

ESLint is moving away from their old config format entirely. It's not really about prefixing with a ., which is usually just to treat the config as a hidden file.

I more meant there doesn’t seem to be a strong enough use case for eslint to support dot-prefixed configs in their new system. What’s different about lua where this would be worth a more complicated config resolution?

chriscerie avatar Mar 19 '24 21:03 chriscerie

I'm going to close this for now as I don't see the benefits worth the added complexity. I'm not entirely opposed to reopening this in the future if there's a stronger motivation.

chriscerie avatar Mar 23 '24 16:03 chriscerie

chriscerie as already mentioned, it is a strong convention for all linters across all operative systems.

You can check out other tools.

Zeioth avatar Mar 23 '24 23:03 Zeioth

In case you are not familiar, on UNIX system (Linux, MacOS, and others), adding a dot in front of the file, make the file hidden for file browsers. That way we avoid polluting our user projects.

Zeioth avatar Mar 23 '24 23:03 Zeioth

What’s different about lua where this would be worth a more complicated config resolution?

Right, as stated it has nothing to do with Lua and entirely to do with supporting filesystems that expect prefixing with a dot to hide files. This can easily be asked of any tooling that uses the file system. I can't find any documentation one way or the other with regard to eslint because, again, this is a new file name with an entirely new format and that coincidentally is removing the dot prefixing the old name. If they don't have plans for this with their new format I would fully expect issues to show up very quickly for it for the same reason, just as you find issues of the same nature for virtually every tool.

The better question is what makes selene unique to other tools in not wanting/needing to support hidden files on unix filesystems?

LastTalon avatar Mar 25 '24 20:03 LastTalon

Thanks. When we see a mainstream tool move away from a convention it's natural to question why and it's better to document such considerations now than later.

chriscerie avatar Mar 26 '24 16:03 chriscerie