Seems that in practice most people are using yml (maybe Rails has something to do with this). I'm fine with supporting both formats, but for me this is one more argument if favour of moving to a Ruby-based config. :-)
@jonas054 Any thoughts on this?
Very little to gain from supporting .rubocop.yaml, just more complexity IMO (for example, what happens when files with both extensions are found). We're already specifying the .rubocop part, so I think we can require the extension to be .yml.
Fair enough.
just more complexity IMO (for example, what happens when files with both extensions are found)
raise "More then one of configuration files found: #{files.inspect}" if files.size > 1 ā is it too complex?I think it is a little out of place to disagree about the complexity and maintenance burden, and then not make the PR and offer to support it. I can't keep up with the issues created on this project. It needs all the support it can get.
I think it is a little out of place to disagree about the complexity and maintenance burden, and then not make the PR and offer to support it.
I don't want to create the PR because the issue about this was closed just because "complexity of supporting". This repo has tests, which simplify supporting features, but no, there is no "make PR if you want", there is "let's don't do this!".
Also contributing to the complexity of supporting two extensions:
.rubocop_todo.yaml in some situations? b) We update .rubocop.yml today with inherit_from: .rubocop_todo.yml. That might need to change too.I still think it's not worth it.
@jonas054 For question 1, we need to mention .yaml only once. For question 2a, no. .yml is the default. User requiring .yaml will rename the file and update the inheritance anyway. They only do it once per project, not a big deal.
They only do it once per project, not a big deal.
Plus every time they re-run --auto-gen-config. I remain unconvinced. :slightly_smiling_face:
@jonas054 I think I have some misunderstanding about --auto-gen-config; is it supposed to run frequently? Currently our team only run it once (when we start to use Rubocop in the project), then work to eliminate the .rubocop_todo.yml. I assume this is why we call it TODO. It doesn't feel right to generate it again and again.
@FranklinYu there's a workflow where a developer works on resolving offenses while looking at the generated .rubocop_todo config, then runs rubocop --auto-gen-config, and looks at the git diff to check their progress.
@mikegee Thank you. This wasnāt our case, probably because there werenāt that many things in .rubocop_todo; but I guess this works for some organization.
Even in this case, I think I can accept both .rubocop_todo.yml and .rubocop_todo.yaml.
I still think it's not worth it.
Not worth what? Development? If so, is PR welcomed? I would totally understand if no one in the organization want to spend time, and this is how community works. If this feature is at least considered reasonable, other developers like me can provide help.
Not worth what? Development?
No I was thinking about maintenance when I said that. I foresee a number of problems if we allow two different file names for the configuration file.
.rubocop.yml?" anymore. You'd have to say "What's in your .rubocop.yml or .rubocop.yaml?"..rubocop.yml..rubocop.yaml should be silently ignored.rubocop.yml should be silently ignored.rubocop.yaml becomes more popular over time? People will request that .rubocop_todo.yaml be generated. Or configurable.This is what I came up with right now. It's impossible to anticipate all problems and opinions the users will have. So to me, this is a clear case of not enough benefit for the effort. We're introducing complexity, but for what purpose?
When answering support questions, you can't just say "What's in your .rubocop.yml?" anymore. You'd have to say "What's in your .rubocop.yml or .rubocop.yaml?".
"What's in your RuboCop config file?"
If you want to search for RuboCop configuration in a large directory tree, or on GitHub, you'd have to search for two different file names or a pattern, not just for .rubocop.yml.
.rubocop.* or .rubocop.y{a,}ml
an error should be reported
Of course.
What if .rubocop.yaml becomes more popular over time? People will request that .rubocop_todo.yaml be generated. Or configurable.
It should be by default, as YAML spec says.
It's impossible to anticipate all problems and opinions the users will have.
And that's why we have standards, specs and guidelines. And YAML's standard says that .yaml is single correct file extension.
We're introducing complexity, but for what purpose?
To follow standards. In tool for community standards.
It should be by default, as YAML spec says.
I canāt find that at https://yaml.org/spec/1.2/spec.html. Please point me in the right direction.
ā-
Edit
It is phrased as a recommendation at https://yaml.org/faq.html
I canāt find that at https://yaml.org/spec/1.2/spec.html. Please point me in the right direction.
The issue-start comment.
It is phrased as a recommendation at https://yaml.org/faq.html
Hm, maybe.
As appeal.
Is it possible to use .yaml in RuboCop? I think, yes.
4. What if
.rubocop.yamlbecomes more popular over time?
ā¦It means that we made the wrong choice between .yml and .yaml? š
I expect .yaml to be mentioned in the documentation only a few times, so most places will still use .yml. If .yaml gets popular even in that case, this means .yaml is significantly superior (which you won't agree).
3. What should happen if both files are found? People will have different opinions on that
Raising an error is decent, but if nobody even wants to maintain this logic: make this āundefined behaviorā and ask those āpeopleā to RTFM.
As for why they propose (and I prefer) .yaml over .yml (in case anyone wonders): it's to prevent collision. For example, I canāt tell whatās a .pl file. Itās not just āone more lettersā; itās āuse full nameā. Using 3 letters or less is to be compatible with DOS. (Anyone still use DOS nowadays?)