Can we rename Cargo.toml?

What about cargo.toml (lowercase C) and cargolock.toml? Or lockcargo.toml? cargol.toml?

I don’t see a compelling reason to change the name of this file. The package manager is Cargo. And so Cargo.toml makes it clear that it has to do with the package manager. I won’t be arguing about this too much because in the end, it’s just a file, but I don’t get what changing the name of this file will bring us, apart from having to rename it in all existing Cargo projects.

I think that changing the name of the file just so it feels familiar is not a good reason. If Rust had tried to feel familiar, it wouldn’t be Rust.

Finally, I’ve always found the idea of having file inside the name of a file questionable.

EDIT: Since writing this, the posts below have convinced me that cargo.toml might make things easier to type. And so I support this suggestion.

1 Like

Using your same argument (which I do not agree with) you call cargo on the command line, so the file should be called cargo.toml.

Cargo is a proper noun, it should be capitalized, Python has Pip (setup.py), Java has Maven (pom.xml), Gradle (gradlew.bat), Ant (build.xml), etc. but as you see, they are all lowercase files.

Rust does not, i repeat not, try to be different. The whole point of Rust is that it does nothing new, but stands on the shoulders of giants, so to speak. Lifetimes are from Cyclone, much of the syntax is from ML- or C-like languages. Rust is familiar.

So you are saying we should be different for the sake of being different? All of the configuration files that I have seen with an extension start lowercase. The argument that brought up was to group it with configuration files. This is from the *file precedent, and does not belong with the style we are using.

From your post, I’m assuming you’re replying to me.

About the filename: IMO, cargo.toml and Cargo.toml is pretty much the same. Calling it the one or the other doesn’t make much difference apart from where the file appears when you list files (since C < c). When I talked about Cargo and Cargo.toml, I just meant that having Cargo and Cargofile, or Cargo and setup.cargo was not clearer than Cargo and Cargo.toml. Maybe I should have been more clear on that particular point.

About Rust being different: I did not say that Rust tries to be different. I said it did not try to feel familiar. Otherwise, we would probably have parenthesis around if statements, since the 4 most used languages (according to http://langpop.com: C, Java, PHP, Javascript and C++) have that. This is the first time I hear about Cyclone and from a quick Google search, it seems difficult to say that Cyclone is familiar. All I’m saying is that Rust is not trying to be the same.

I disagree, having to hit shift for no reason for the test of time heavily outweighs any negatives from updating the current packages in the wild. It is non-trivial mental overhead for me when working in a terminal, because usually all the other files are all lower-case.

I’ve never had terminal issues due to case, because my bash will autocomplete with tab regardless of case.

1 Like

Same as @steveklabnik for me.

Although I’m wondering about something: is case insensitive matching easy on Windows too? What is the reason to not have case insensitive auto completion? This is a real question, not a rhetorical one. I’m wondering. I have never come accross a project with two files named the same with different casing, hence my question.

For the record, if you’re on Linux and want case insensitive matching for Bash, this should do it (this may work for other shells and UNIX like OSs, but I haven’t tried that):

echo "set completion-ignore-case on" >> /etc/inputrc

This does not solve the fact that when I type car<TAB>, I do not get the full autocomplete because there is a choice between Cargo.toml and Cargo.lock to make. Is there a need to edit Cargo.lock manually? If not, maybe that could be changed to something like .Cargo.lock. This way, autocomplete is more useful and the file would just be recreated on the next cargo build.

1 Like

(The Linux kernel is such a project, causing woe to OS X users who try to compile it inside the default case-insensitive filesystem.)

Inside Windows cmd.exe you can always case-insensitive match. For example if I have ā€œbanana.txtā€, ā€œBanana.jsonā€, and ā€œBANANA.CSVā€ in a directory, and I type ā€œgvim ban[TAB]ā€ I get one of those, ā€œ[TAB]ā€ again I get the second, ā€œ[TAB]ā€ again the third, and cycling back again for further tabs.

(This is one way, perhaps the only way, in which I prefer cmd.exe over Bash’s default behavior.)

+1 to cargo.toml. I prefer lowercase file name, as most of others.

1 Like

I really don’t understand ANY of the motivation for keeping the upper case convention. It’s simply forward looking to fix it now and just make it lowercase before MORE projects are created.

1 Like

Can anyone provide a reason to prefer the capital ā€˜C’ over lowercase ā€˜c’ besides needing to rename the file in projects that exist today?

1 Like

The rationale by the Cargo maintainer was linked in the first post:

Thanks for linking me this. Atleast I understand the rationale now :smile:

If you wanted to have lowercase file names, and can’t have it starting with a ā€˜.’, could you use an underscore? ā€œ/_cargo.tomlā€ and ā€œ_cargo.lockā€.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.