-
Notifications
You must be signed in to change notification settings - Fork 56
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
How should we handle invalid config? #32
Comments
At this stage of rufo (pre Later (after IMHO, option 3 is out of question. It's too dangerous, I think. Add Just my 2 cents. |
The way I see it users shouldn't be penalised by having an out-of-date config by giving them an error and no formatted output (which will happen since options are disappearing). Especially since the old config may well conform to the actual format anyway! I would rather see formatted output with a deprecation warning to stderr - and a quiet command line option to quieten the warning if IDE implementers prefer. We are after all at least theoretically aiming for a zero config formatter where we would ignore the config altogether. As the config options reduce in size it may make sense allowing configuration as command line options. A check config option would be very useful. |
I got your point. My Angst about warning users ("Your config is deprecated or contains deprecated values") is that no-one actually reads deprecation warnings. (myself included 😨) As a user, I would be very surprised to see my code changed after upgrading WDYT? |
How about a config option Once we stablise (1.0) perhaps it can default to |
Seeing as upgrading In fact, the closer we get to a zero config formatter, the more this is to be expected. You'll be trusting the tool to format your code the way it sees fit, as of the current version. This is how I currently see As for the confusion caused by a previously working configuration variable no longer having an effect, I think a warning to stderr provides a good balance. You'll notice the warning if you run |
Speaking of 1.0, maybe the config file should be versioned..? In that case it would make sense to require a config update when bumping the major version, but keep working across minor changes. That may not be a very good fit for |
I'm with Emil, that's how prettier behaves and that's what I would expect
from Rufo too.
…On Fri, 13 Oct 2017 at 05:03 Emil Sågfors ***@***.***> wrote:
How about a config option fail_on_invalid_config :fail/:warn/:ignore which
defaults to :warn.
Once we stablise (1.0) perhaps it can default to :fail ?
Speaking of 1.0, maybe the config file should be versioned..? In that case
it would make sense to require a config update when bumping the major
version, but keep working across minor changes.
That may not be a very good fit for rufo if the aim indeed is to get as
close to zero-config as possible, so take it with a grain of salt. I just
realized I've seen lots of projects introduce version: 2 in their config
format to distinguish from the original, non-versioned format. :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AArOaMPFS2_RU3R11W92IHbZ3kRYafslks5sr1FygaJpZM4P3fKX>
.
|
This has been resolved in #41 :) |
As raised by @bessey, see here, we should probably do something about invalid config that is defined in a
.rufo
file.This will help users know that their config is actually doing something.
Some of the options include:
--check-config
Thoughts?
The text was updated successfully, but these errors were encountered: