I'm looking for suggestions to file naming convention in a Git repository.
The repository is checked out to and committed from client machines with different OS's and locale settings, which may not have exactly consistent letter case sensitivity and character encodings, and behaviors towards some special characters;
The repository has files whose file name must contain multiple complete english words for business reasons, for example, some file names must contain
home_value
, orhome-value
, orHomeValue
rather than some abbreviated form where the complete English words aren't recognizable such ash_v
orh-v
orHV
.
So I am wondering what rules of convention should be set up for the team, to reduce potential issues. A change of convention or an effort of coercing file naming styles later in could be a pain and counter productive. So I'd like to set up as detailed convention as possible from early on. I could then make stewart scripts to automatically validate the code base.
Some initial thoughtlets:
some possible formatting conventions I can think of
foo_bar # use _ as word separator foo-bar # use - as word separator FooBar # use CamelCase
some of the files are HTML files that will be served on web server.
always use ASCII characters
non-ASCII characters should be converted to Unicode code, for example
U+12345
always use lower case, e.g.
foo_bar
but notFoo_Bar
orFooBar
, to avoid conflict between two files namedfoo_bar
andFoo_Bar
. The possible issue with this is that some complete English word I mentioned above are proper nouns and needs to have capitalized initial letter. If the information is lost in the file name, it will need to be stored in some other way.If lowercase letter is always used, then CamelCase is not an option
Some complete English words can have
-
in it, for example some English names, so it seems thefoo-bar
style is not an option. The only left possibility isfoo_bar
?If I then allow capital letter to accomodate proper nouns, then in general, a file name is
foo_Bar_FooBar
But is it a good idea?