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

Allow `cargo.toml` #45

Closed
steveklabnik opened this Issue Jun 24, 2014 · 25 comments

Comments

Projects
None yet
@steveklabnik
Copy link
Member

steveklabnik commented Jun 24, 2014

From http://www.reddit.com/r/rust/comments/28xyrc/cargo_alpha_is_here/cifnlkg

Would be nice to be consistent with make, and while I prefer Cargo.toml, apparently a bunch of people feel the other way.

@tbu-

This comment has been minimized.

Copy link
Contributor

tbu- commented Jun 24, 2014

I'd say a standard is better than everyone doing as they want.

@thehydroimpulse

This comment has been minimized.

Copy link

thehydroimpulse commented Jun 24, 2014

Agreed. Cargo.toml feels a bit unnatural when all other files are lowercased.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 24, 2014

@tbu- normally, I'd agree with you, but we also have to consider case-insensitive filesystems.

@tbu-

This comment has been minimized.

Copy link
Contributor

tbu- commented Jun 24, 2014

@steveklabnik Fair point.

@gilles-leblanc

This comment has been minimized.

Copy link
Contributor

gilles-leblanc commented Jun 24, 2014

I have started looking into this.

@steveklabnik Do we want to be case-insensitive for so we can support case-insensitive systems or do we simply want to allow Cargo.toml and cargo.toml ?

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 24, 2014

I personally feel we should do what make does: look for a cargo.toml and then a Cargo.toml. I'd like to hear @wycats 's thoughts though.

@wycats

This comment has been minimized.

Copy link
Contributor

wycats commented Jun 24, 2014

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

@gilles-leblanc

This comment has been minimized.

Copy link
Contributor

gilles-leblanc commented Jun 24, 2014

@wycats I know in Ruby I'm used to seing Gemfile, Rakefile and other files with a leading capital letter.

There are many possible conventions.

Another one is dot files with a prefixed dot followed by all lowercase letters.
Make seems to use all lowercase letters by default with no dot.
I'm also used to seeing .yml or .json config files all in lower case.

So I guess there's a lot of different styles. I would be partial to allowing cargo.toml but it wouldn't bother me either way as a Cargo user.

Tell me guys if we should continue with this one or if we should close it and keep the current convention.

If we go ahead I'll try and make a patch.

@wycats

This comment has been minimized.

Copy link
Contributor

wycats commented Jun 24, 2014

You don't want a leading . because that cuts against the grain of the git CLI.

I'd rather stick with the current convention, for the reasons I described. We can revisit this if it causes real problems.

@wycats wycats closed this Jun 24, 2014

@brendanzab

This comment has been minimized.

Copy link
Member

brendanzab commented Jun 24, 2014

Capital letters group it together with other similar configuration files

What other configuration files?

@sinistersnare

This comment has been minimized.

Copy link

sinistersnare commented Jun 25, 2014

@bjz id imagine Rakefile, Makefile, Gemfile at least. Notice that none of these have file extensions, whereas Cargo.toml does.

Id prefer cargo.toml or Cargofile. It is strange to have the capitalized word and the file extension.

Cargofile is more to 'convention' than @wycats's argument. Config files with file extensions such as 'setup.py', 'project.clj' and 'pom.xml' all start with lowercase. Cargo's approach seems to be actually _most_ against the current convention than anything I have seen so far.

@asb

This comment has been minimized.

Copy link

asb commented Jun 27, 2014

+1 for Cargofile or cargo.toml. Cargo.toml is a weird merging of two conventions.

@aroman

This comment has been minimized.

Copy link

aroman commented Jul 5, 2014

Another +1 for the proposed compromise — Cargofile or cargo.toml — rather than the current Cargo.toml. I can't think of a single other language that follows the Capitalized + extension convention for non-source files.

@SaberUK

This comment has been minimized.

Copy link

SaberUK commented Jul 5, 2014

I agree with making it lower cased. In general, build system file names either match ^[A-Z][a-z]+file$ or ^[a-z]+\.[a-z]+$. It isn't very common to use a mix of both. The only exception I can think of is CMake but I think that was designed in Windows land where everything needs a file extension.

@beatgammit

This comment has been minimized.

Copy link

beatgammit commented Sep 4, 2014

You don't want a leading . because that cuts against the grain of the git CLI.

@wycats - How so? In my projects, I have .gitignore, .jshintrc and other dot-prefixed files. They seem to behave as any other named file from my experience.

Another +1 for the proposed compromise — Cargofile or cargo.toml — rather than the current Cargo.toml. I can't think of a single other language that follows the Capitalized + extension convention for non-source files.

I agree. I would prefer cargo.toml, but wouldn't complain too loudly against Cargofile. Nearly every configuration file I use is lowercase (granted, without an extension), and there's already precedent for ^[a-z]+\.[a-z]+$ (among others already mentioned):

  • npm: package.json
  • bower: bower.json (which admittedly is probably following npm's lead)
  • cabal: <project>.cabal (e.g. cargo.cabal)
  • luarocks: <project>-<version>.rockspec
  • ant: build.xml

I'm sure there are more examples for both sides, but I don't think there's an argument for saying ^[a-z]+\.[a-z]+$ is any less standard than ^[A-Z][a-z]+\.[a-z]+$. There is, however, precedent for lower-case filenames in Rust and on case-sensitive filesystems, and it doesn't matter as much for case-insensitive filesystems, so the preference (IMHO) should go to the more restrictive environment.

I haven't used a case-insensitive filesystem for years, so I'm a bit out-of-the-loop in terms of conventions there, so I could be missing something important.

@mahkoh

This comment has been minimized.

Copy link

mahkoh commented Sep 4, 2014

@wycats

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

I don't care either way but this is only true with LC_COLLATE=C and not with en_US.UTF-8.

@brendanzab

This comment has been minimized.

Copy link
Member

brendanzab commented Sep 5, 2014

Having a .toml file extension is good for syntax highlighters, so cargo.toml > Cargofile > Cargo.toml for me.

@sinistersnare

This comment has been minimized.

Copy link

sinistersnare commented Sep 17, 2014

@wycats can you please comment on the discourse thread for this issue? there has been a lot of discussion in favor of cargo.toml instead of uppercase Cargo.toml.

@tbu-

This comment has been minimized.

Copy link
Contributor

tbu- commented Sep 17, 2014

I guess there isn't such a large discussion because this is mostly bikeshedding. (?)

@asb

This comment has been minimized.

Copy link

asb commented Sep 18, 2014

@tbu- it kind of is, but on the other hand Cargo seems to arbitrarily choose to eschew either of the standard naming conventions for this sort of file (either cargo.toml or Cargofile) as @beatgammit explains

@jestan

This comment has been minimized.

Copy link

jestan commented Oct 7, 2014

+1 for cargo.toml or Cargofile. I just started using Cargo and felt strange about the build filename

@tbu-

This comment has been minimized.

Copy link
Contributor

tbu- commented Nov 8, 2014

@dbrgn

This comment has been minimized.

Copy link
Contributor

dbrgn commented Dec 12, 2014

+1 for cargo.toml > Cargofile > Cargo.toml

@shawnscode

This comment has been minimized.

Copy link

shawnscode commented Dec 31, 2014

+1 for cargo.toml

@skyne98

This comment has been minimized.

Copy link

skyne98 commented Jan 12, 2019

+1 for cargo.toml too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment