-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow $
in casing-related rules
#453
Allow $
in casing-related rules
#453
Conversation
@ernestognw Thanks a lot for your input So we need to make sure it doesn't break any other ruleset Also, as I understand in the lib/common/identifier-naming.js there are and (I'm not sure) but I think |
Hey @dbale-altoros, Yes, I think generally the mixed case should not fail if there's a I would say that allowing only standalone I can update the other rules if you think it's the way to move forward |
yes, the main thing is the leading $ I'm thinking if this really worth the hassle... If you are up to check in the other rules and add tests to make sure this won't break, we can move forward... if not, we can wait on this fix since doesn't seem to be a high priority What do you think ? |
Thanks also for your prompt response! Sure I think I can take a look at other rules and add tests. Just confirming, should I look only for rules using the following functions?
|
yes, I think so |
I also changed the base from master into develop thanks a lot for your contribution and time... we appreciate!!! |
Thanks for the guidance @dbale-altoros, I just marked this as ready for review since I already added tests for the rules affected. Should be enough but please let me know if there's something I'm missing. |
of course... this week or next it will be reviewed by team |
$
in var-name-mixedcase
$
in mixedcase
rules
$
in mixedcase
rules$
in casing-related rules
@ernestognw sorry this is taking so long So this pr has a few conflicts, I don't want to mess it up |
} | ||
|
||
for (const [key, code] of Object.entries(WITH_$)) { | ||
it(`should not raise event name error for events ${key}`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems this description is not ok, right ?
Don't worry I'll fix... just wanted to make sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct, it had to be:
it(`should not raise event name error for events ${key}`, () => { | |
it(`should not raise event name error for constants ${key}`, () => { |
for (const [key, code] of Object.entries(WITH_$)) { | ||
it(`should not raise event name error for events ${key}`, () => { | ||
const report = linter.processStr(code, { | ||
rules: { 'contract-name-camelcase': 'error' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should be event-name-camelcase, right ? (I fix)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, it should be:
rules: { 'contract-name-camelcase': 'error' }, | |
rules: { 'event-name-camelcase': 'error' }, |
} | ||
|
||
for (const [key, code] of Object.entries(WITH_$)) { | ||
it(`should not raise func name error for functions ${key}`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for Event Parameters
(wrong description on IT statement)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it(`should not raise func name error for functions ${key}`, () => { | |
it(`should not raise func name error for event parameters ${key}`, () => { |
} | ||
|
||
for (const [key, code] of Object.entries(WITH_$)) { | ||
it(`should not raise func name error for functions ${key}`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==> for modifiers
(wrong description on IT statement)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it(`should not raise func name error for functions ${key}`, () => { | |
it(`should not raise func name error for modifiers ${key}`, () => { |
I will close this PR With these modifications and fixes |
Yeah, I got also a bunch of copy paste errors, sorry for that. No issue having another PR, thanks for the review! |
Fixes #452
I acknowledge the issue requires a bit more discussion but I'm opening this PR in case there's no push back for this rule change.
Alternatively, we can pass it as part of the rule configuration, similar to: