Skip to content

Conversation

@buzzdeee
Copy link
Contributor

For #define something in C, only alphanumeric and _ are allowed.

When creating a new file in the project, esp. headers, some ifdef dance is added, to prevent double inclusion. This take the file name literally.

For Categories, it's common to use NSSomeClass+Category as name, and that + sign breaks build.

Therefore sanitize the generated uppercase header file name, replace any non alphanumeric and _ with _ before replacing the string in the template.

When creating a new file in the project, esp. headers, some ifdef dance is added,
to prevent double inclusion. This take the file name literally.

For Categories, it's common to use NSSomeClass+Category as name,
and that + sign breaks build.

Therefore sanitize the generated uppercase header file name, replace
any non alphanumeric and _ with _ before replacing the string in
the template.
@buzzdeee buzzdeee requested a review from gcasa as a code owner August 30, 2024 21:21
if ([allowedCharacters characterIsMember:character])
{
[sanitizedString appendFormat:@"%C", character];
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This else should be on separate lines... like so...

}
else
{

Other than that looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants