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

Support Pascal Case for L030 #2736

Closed
3 tasks done
fdw opened this issue Feb 28, 2022 · 5 comments · Fixed by #2739
Closed
3 tasks done

Support Pascal Case for L030 #2736

fdw opened this issue Feb 28, 2022 · 5 comments · Fixed by #2739
Labels

Comments

@fdw
Copy link
Contributor

fdw commented Feb 28, 2022

Search before asking

  • I searched the issues and found no similar issues.

Description

It often makes sense to have function names as PascalCase, for example DateAdd or IsNull. Unfortunately, L030 only offers upper, lower and capitalize, which are all less than ideal for these cases.

Use case

I would like my function names to be easily readable. For names that consist of multiple words, PascalCase makes the most sense.

Dialect

At least T-SQL, but probably relevant for all dialects.

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

@fdw fdw added the enhancement New feature or request label Feb 28, 2022
@tunetheweb
Copy link
Member

Can you be clear what you mean by PascalCase here?

I presume you mean:

  • Starts with a capital letter? Or happy with pascalCase too?
  • Has at least one lowercase letter? Or is EXAMPLE still valid PascalCase?
  • Depending on above should it end in a lower case?
  • For Autofix the best we could do is initial capital letter (e.g. examplefunction or EXAMPLEFUNCTION would both be autofixed to Examplefunction rather than ExampleFunction which is probably the right answer but impossible to really get a system to understand)? Or should PascalCase not be Autofix compatible so always will require manual intervention?
  • Should it convert snake case? E.g. pascal_case is converted to PascalCase?

Depending on answer to those (particularly the second one) it might be best to just turn off rule L030 rather than add to it.

@fdw
Copy link
Contributor Author

fdw commented Feb 28, 2022

As L014 already has PascalCase, I thought it could and should use the same logic 🙂

@tunetheweb
Copy link
Member

Oh that makes it easier: #2739

Is a breaking change though as requires all users of this rule to update their config 😞
But I think a good change.

@fdw
Copy link
Contributor Author

fdw commented Feb 28, 2022

That was fast, thank you!

@tunetheweb
Copy link
Member

Luckily was simple once you pointed me in the right direction! 😁

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.

2 participants