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

In line exemption for custom rules #111

Closed
nevengrgic opened this issue Nov 11, 2022 · 5 comments
Closed

In line exemption for custom rules #111

nevengrgic opened this issue Nov 11, 2022 · 5 comments

Comments

@nevengrgic
Copy link

I wrote the following rule to check for explores that are defined in view files, which we do not want to allow on our instance. When I try to do an exemption within one view file, the in line exemption is not recognized. I saw a similar issue with a custom rule (#50) was resolved, but wanted to check if different custom rule configurations could still raise issues for in line exemption. Thanks!

#  rule: C3 {
#  description: "Explores must not exist within view files"
#  match: "$.files[*]"
#  expr_rule: 
#
#  //for files that are of type view, check that the explore key is undefined If defined, alert the developer
#  ($if
#      ($all
#          (=== ::match:$file_type "view")
#          (!== ::match:explore undefined)
#      )
#              ($concat "View file " ::match:$file_name " contains an explore. Move the explore to the appropriate model file.")
#              true
#  )
#  ;;
#  }

In line exemption

  #  LAMS
  #  rule_exemptions: {
  #   C3: "this explore is actually okay"
  #  }
@fabio-looker
Copy link
Contributor

fabio-looker commented Nov 11, 2022

Hi @nevengrgic 👋

I vaguely recall intending to make rule ID's of the form [A-Z][0-9]+ (i.e. one letter and a number) to be reserved for future LAMS use, so there may be an issue caused by that... but I will look into this and see what I find.

Edit: I guess to be clearer: My expectation of the intended functionality is that the rule exemption should prevent an error from being raised for that file for this custom rule

@nevengrgic
Copy link
Author

Hi @fabio-looker! Thanks for the quick response.

You are correct about the expected functionality. I also tried changing the name based on your first comment, but that didn't appear to change anything. Appreciate your help!

@fabio-looker
Copy link
Contributor

I realized that this is probably the same bug as issue #123

The fix is currently available in the v3 beta: https://www.npmjs.com/package/@looker/look-at-me-sideways/v/3.0.0-beta.0

Release notes: https://github.com/looker-open-source/look-at-me-sideways/blob/fabble/v3-extends-refinements/docs/release-notes/v3.md

If you do not want to upgrade to v3, let me know and I can also patch this into v2

@fabio-looker
Copy link
Contributor

Hello!

Although this was fixed in 3.0.0-beta.0 , that beta release had several issues. Many of those issues are fixed in the next beta pre-release 3.0.0-beta.1.

v3 release notes

I'll keep this issue open until v3 is out of beta. Thank you for your feedback thus far!

@fabio-looker
Copy link
Contributor

v3 is now generally available.

If you continue to experience any issues, please let me know. Thank you for reporting this and for your continued feedback!

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

No branches or pull requests

2 participants