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

Address Rego Linter (Regal) Rules #615

Closed
Tracked by #638
buidav opened this issue Oct 26, 2023 · 1 comment · Fixed by #640
Closed
Tracked by #638

Address Rego Linter (Regal) Rules #615

buidav opened this issue Oct 26, 2023 · 1 comment · Fixed by #640
Assignees
Labels
enhancement This issue or pull request will add new or improve existing functionality

Comments

@buidav
Copy link
Collaborator

buidav commented Oct 26, 2023

💡 Summary

This issue is to address follow ups from #594 along with any other Linter rules we wish to follow.

First follow up to address:

  1. line length
  2. identically named tests
  3. constant condition* (see the original comment chain for more context)

Second follow up to address:

   # https://docs.styra.com/regal/rules/testing/test-outside-test-package
    test-outside-test-package:
      # This is just a style preference
      level: ignore

"gdasher I think we should think about having this on as a warning or error. While it is more style (the program will still run when ignored), I think it is good practice. It would cause us to need to refactor some things, but the size should be small."

Third follow up

      level: ignore
    # https://docs.styra.com/regal/rules/style/prefer-some-in-iteration
    prefer-some-in-iteration:
      level: ignore

" Right now a lot of our code does not use some in iteration, but I have notice that there are some cases where some in is the only way the code will work correctly vs var := input_var[_], do you know of any cases where the opposite is true. If not, i would not be against turning it on because I think it will decrease the amount of miss-typing = instead of :="

Motivation and context

Follow up of #559

Implementation notes

We will have to break this issue up into smaller issues.
Addressing everything in just one PR could be done but we prefer not to these days ;).  

Acceptance criteria

The follow ups above are addressed.

@buidav buidav added the enhancement This issue or pull request will add new or improve existing functionality label Oct 26, 2023
@buidav buidav added this to the Flipper milestone Oct 26, 2023
@buidav buidav mentioned this issue Oct 26, 2023
12 tasks
@Sloane4 Sloane4 self-assigned this Nov 3, 2023
@Sloane4
Copy link
Collaborator

Sloane4 commented Nov 3, 2023

I would also like to add a warning to this rule

rule-length:
      level: ignore
    # https://docs.styra.com/regal/rules/style/todo-comment

@Sloane4 Sloane4 mentioned this issue Nov 3, 2023
14 tasks
@Sloane4 Sloane4 linked a pull request Nov 3, 2023 that will close this issue
12 tasks
@Sloane4 Sloane4 closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants