Skip to content

[WIP] Classifies names according to case, uses for filename generation. #1759

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

Closed
wants to merge 1 commit into from

Conversation

gspencergoog
Copy link
Collaborator

@gspencergoog gspencergoog commented Sep 21, 2018

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 and theUi are both lowerCamel, 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 instance theUi would have lowerCamel-3-1-1 appended, but theUI would have lowerCamel-3-2) to make them unique.

Addresses #1196

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Sep 21, 2018
@gspencergoog gspencergoog force-pushed the case_fix branch 8 times, most recently from 8a4ead9 to f0e458f Compare September 25, 2018 18:28
@gspencergoog gspencergoog changed the title Classifies names according to case, uses for filename generation. [WIP] Classifies names according to case, uses for filename generation. Sep 25, 2018
@gspencergoog gspencergoog force-pushed the case_fix branch 6 times, most recently from f9296c4 to df1ed79 Compare September 25, 2018 22:13
@gspencergoog
Copy link
Collaborator Author

Closing for now: need to rethink some things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants