Skip to content
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

Turn macro names into a naming conventions rule #515

Closed
elbrujohalcon opened this issue Aug 7, 2020 · 11 comments · Fixed by inaka/elvis_core#131
Closed

Turn macro names into a naming conventions rule #515

elbrujohalcon opened this issue Aug 7, 2020 · 11 comments · Fixed by inaka/elvis_core#131
Labels

Comments

@elbrujohalcon
Copy link
Member

Macro Names is a very strict rule that doesn't follow the regex standard of other similar rules (like Module Naming Convention). It would be a good idea to standardize it.

Ref: WhatsApp/erlfmt#91

@paulo-ferraz-oliveira
Copy link
Collaborator

Related to #404?

@elbrujohalcon
Copy link
Member Author

You're right, this is a duplicate. But since this one has a ref, I'm gonna close @harenson's one :)

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Sep 9, 2020

What should be the default for regex? I mean... -define('A-Z', 2) compiles just fine, but do we want to allow this, by default? I'm thinking of a simple [_A-Z0-9]+ but will search elsewhere if there are any conventions that could be followed.

We could also leave the default validation as is, "all uppercase", and only use regex if defined.

What's your idea, @elbrujohalcon?

@paulo-ferraz-oliveira
Copy link
Collaborator

I found that -define('A,aZ', 2). doesn't fail the tests either (or reports as bad analysis) since the regex used to find the macro name is too permissive. I haven't found the write one yet, but wanted to report on this so I don't forget it later.

@paulo-ferraz-oliveira
Copy link
Collaborator

Linked to inaka/elvis_core#131.

@paulo-ferraz-oliveira
Copy link
Collaborator

Reminder for future me: if this gets approved, you, @paulo-ferraz-oliveira, should update the Wiki.

@elbrujohalcon
Copy link
Member Author

I wrote a few comments in that PR

@elbrujohalcon
Copy link
Member Author

BTW… You can use [Fix inaka/elvis#...] in your PR titles/descriptions to automatically link them to the issues here.

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Sep 10, 2020

BTW… You can use [Fix inaka/elvis#...] in your PR titles/descriptions to automatically link them to the issues here.

Done. But the link didn't "happen" though.

@jfacorro
Copy link
Contributor

Done. But the link didn't "happen" though.

Sadly the link is only parsed in the comment section, the title is shown as plain text.

@paulo-ferraz-oliveira
Copy link
Collaborator

Done. But the link didn't "happen" though.

Sadly the link is only parsed in the comment section, the title is shown as plain text.

I actually kind of prefer it like this, since otherwise the titles would pollute the CHANGELOG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants