[WIP] Classifies names according to case, uses for filename generation. #1759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when you generate docs for dartdoc itself, there are some symbols (from the args package, but they could be from anywhere) where there are metamers of those symbols. When dartdoc generates the filenames, it generates the same name with different case. This is fine on Linux, where filenames are case sensitive, but on macOS, which is case preserving, but case insensitive, they map to the same file. So, once you check it in to git, you can't sync that repo to macOS without git complaining that the files are modified.
This fixes that problem by classifying types as having different capitalization (camel case, upper case, lower case, lower camel case), and using those in the filenames. The default is camel case, so no identifier is added to symbols with CamelCase names, but others get
-upper
,-lower
,-lowerCamel
, or-camel
, depending on their type. Each kind of symbol has a "case default" that is implied and not appended if the name matches that case. For instance, a class using camel case, or a method using lower camel case would not have any suffix.For cases that don't fall into those (for instance
theUI
andtheUi
are bothlowerCamel
, but they would have the same filename on a case-insensitive filesystem), it appends a set of numbers that represent the case runs (the number of consecutive letters with the same case) in the name (for instancetheUi
would havelowerCamel-3-1-1
appended, buttheUI
would havelowerCamel-3-2
) to make them unique.Addresses #1196