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

Simplify G-1050 and related examples #206

Closed
PhilippSalvisberg opened this issue Sep 26, 2023 · 0 comments · Fixed by #207
Closed

Simplify G-1050 and related examples #206

PhilippSalvisberg opened this issue Sep 26, 2023 · 0 comments · Fixed by #207
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@PhilippSalvisberg
Copy link
Collaborator

This version of G-1050 describes the following exceptions:

  1. Literals in logger calls
  2. Literals in views
  3. Literals that are used less than 3 times in a file

Number 2 and number 3 have been introduced after the release of version 4.2. After some consideration this rule is

a) too complicated and
b) not stringent.

For example, literals in views are okay, but not OK in SQL Scripts with insert statements? Additionally, the exclusion of views is based on some corner cases where a function wrapping a constant is leading to a bad execution plan.

To simplify the rule, let's state the following (replacing the last three paragraphs):

To avoid an extreme abundance of constants or false positives, a literal should not occur more than once within a file.

Furthermore the examples in the chapter "Language Usages" should simplified accordingly.

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

Successfully merging a pull request may close this issue.

1 participant