Can we rename Cargo.toml?


#21

projectname.cargo makes a lot more sense to me.


#22

True, albeit there is a catch. Format *.cargo is undefined while *.toml has specification.


#23

This is already violated by cargo. The Cargo.lock file has a .lock extension, but it’s clearly written in TOML.


#24

I’d also argue that what goes in a cargo file is a lot more restricted than “eh put any toml in there”, so the extension is already unhelpful in that sense in the first place.


#25

I see .jsons and .xml although I haven’t seen a place where you can just put any JSON or XML file. It’s probably common that for general formats like these, the programs don’t accept any valid file.


#26

My visual studio C# projects live in .csproj files and not .xml files even tho on inspection with notepad they’re actually xml files!


#27

im not against setup.cargo or projectname.cargo like .csproj. the extension defines the schema to be a cargo toml schema.

I sure wish that someone with authoritative power like wycats or Alex Chriton would comment here…


#28

I don’t see what you want to say with that. I haven’t said that all XML files have the file extension .xml, I said that some do.

wycats commented on Github (see first post).


#29

I know, I meant on this thread.


#30

Yeah, but Cargo.lock is explicitly computer generated*, so it not having a .toml extension is good. It being .toml helps the system recognize it as a TOML file, albeit one with a specific structure** while keeping the computer generated one without a recognizable extension.

*If I recall the documentation say your changes will be overwritten. ** This is par for the course, lots of config file with specific structure are written in .xml, .yaml, .json, etc.


#31

Another way of putting that is “The fact that the lock is toml is an implementation detail.”


#32

I prefer lower case names, and projectname.cargo seems fine assuming it being variable doesn’t result in cargo not finding it or issues with having two of them in the same place being ambiguous. I like cargo.toml for not being ambiguous.


#33

I’m fine with Cargo.toml. The C being uppercase doesn’t really bother me. But as @ecl3ctic said, cargo.toml would (IMHO) work better because of naming conventions in Unix.

I don’t really like projectname.cargo because it wouldn’t be always the same for every project. Maybe something like package.cargo would be more appropriate.


#34

I would like to cast one vote for cargo.toml, regardless of capitalizaion.

Keeping the file name standard between projects, I think, is preferable.


#35

I would also like to vote for cargo.toml, lower cased, for unix conformity.


#36

I prefer cargo.toml, with a fallback to Cargo.toml. The *File convention is broken.


#37

What about just ‘cargo’ for the file name? Do we need to care about the extension?


#38

I feel its beneficial to have an extension for syntax highlighting purposes. Its easier to detect toml files when they have a toml extension.


#39

So in the absence of wycats’ clarification, I have re-read his quote:

Capital letters group it together with other similar configuration files and avoids it from being interspersed with other files and directories.

I am guessing he means that:

  • Cargo* is good because if you are listing files in alphabetical order, it means that the file is at the top.
  • *.toml is good, because it means that the file is highlighted nicely.

For the reasons posted here I still prefer cargo.toml, but implying that wycats is being irrational here is a mistake.


#40

I support renaming Cargo.lock, because it screws up autocomplete when editing the Cargo.toml file :smile: