generated from cisagov/ScubaGear
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor long lines; refactor GetTopLevelOU function * Unify comment style * Remove 'no domain' helper rules * Change ServiceName to SettingName * Refactor test cases * Change lists to sets where possible * Chat change to for in syntax * Chat change to rule contains syntax * Refactor GetTopLevelOU function * Change lists to sets where possible chat * Remove trailing whitespace * Change ServiceName to SettingName * Standardize comment syntax chat * Refactor chat unit tests * Change to for in syntax * Change to rule contains syntax classroom * Change ServiceName to SettingName * Classroom change lists to sets where possible * Classroom standardize comments * Refactor GetTopLevelOU function Classroom * Refactor Classroom unit tests * Remove stray blank lines classroom * Refactor common functions Drive * Drive change to some in syntax * Remove trailing whitespace * Remove more trailing whitespace * Change to rule contains syntax Drive * Refactor long lines Drive * Drive standardize comments * Refactor Drive unit tests * Refactor drive 2 long lines * Refactor groups unit tests * Groups standardize comments * Rego refactor meet * Refactor 'or' Drive * Refactor sites rego * Refactor utils rego * Move OUsWithEvents rule to the utils file * Calendar fill in topLevelOU in test cases with multiple OU as it cannot be blank in those cases * Chat fill in empty topLevelOU in test cases where needed * Classroom fill in empty topLevelOU in test cases where needed * Drive unit tests fill in topLevelOU where required * Gmail test cases add topLevelOU when needed * groups test cases add topLevelOU when needed * Meet test cases add topLevelOU when needed * Move TopLevelOU rule to utils file * Remove print statements * Move GetLastEvent function to utils file * Moved all shared rego code to the utils file * Import utils package instead of individual rules * push unsaved change * Remove duplicates from list * Change SettingChangeEvents back to filter by log name for efficiency * Refactor groups 7 * Ensure test names are unique * Add regal config file * Add github workflow for regal * Add missing ifs * Bump the version of the regal exe * Trim trailing whitespace rego/Utils.rego Co-authored-by: David Bui <[email protected]> * Trim trailing whitespace rego/Utils.rego Co-authored-by: David Bui <[email protected]> * Correct the ID used in comment rego/Chat.rego Co-authored-by: David Bui <[email protected]> * Move TopLevelOU comments for consistency * Remove trailing whitespace rego/Utils.rego Co-authored-by: David Bui <[email protected]> * Add new line for readability and consistency * Sites change lists to sets * Remove leading whitespace rego/Groups.rego Co-authored-by: David Bui <[email protected]> * Align whitespace rego/Classroom.rego Co-authored-by: David Bui <[email protected]> * Groups align whitespace * Refactor 'ignore ous without events' comment * Remove trailing whitespace from Rego unit tests --------- Co-authored-by: David Bui <[email protected]>
- Loading branch information
Showing
64 changed files
with
3,865 additions
and
4,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,11 @@ jobs: | |
|
||
- name: Run OPA Tests | ||
run: opa test rego/*.rego Testing/RegoTests/**/*.rego -v | ||
|
||
- name: Setup Regal | ||
uses: StyraInc/[email protected] | ||
with: | ||
version: v0.15.0 | ||
|
||
- name: Run Regal Lint | ||
run: regal lint --format github rego Testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Regal linter configuration | ||
# All rules documented here: | ||
# https://docs.styra.com/regal/category/rules | ||
rules: | ||
custom: | ||
naming-convention: | ||
# Codifying the conventions used in this project. | ||
# By all means, change this to be less restrictive | ||
# if you wish. | ||
level: error | ||
conventions: | ||
- pattern: '^[A-Z]+[a-zA-Z0-9_]+$|^tests$|^test_|^check_' | ||
targets: | ||
- rule | ||
- pattern: '^[A-Z]+[a-zA-Z0-9_]+$' | ||
targets: | ||
- function | ||
- pattern: '^[a-z]+$' | ||
targets: | ||
- package | ||
idiomatic: | ||
no-defined-entrypoint: | ||
# This is a good practice for documentation, and | ||
# compilation to Wasm/IR, but not a requirement. | ||
# Safe to ignore. | ||
level: ignore | ||
imports: | ||
implicit-future-keywords: | ||
# This rule is on it's way out anyway, as future | ||
# versions of OPA will make these keywords standard. | ||
level: ignore | ||
style: | ||
external-reference: | ||
# This rule is quite opinionated / style preference | ||
# safe to ignore. | ||
level: ignore | ||
file-length: | ||
level: ignore | ||
no-whitespace-comment: | ||
# This repo is actually good about this, but frequently | ||
# uses '#--' as a delimeter of sorts. That should be OK, | ||
# and the next version of Regal will allow for exceptions | ||
# like this: https://github.com/StyraInc/regal/issues/379 | ||
level: ignore | ||
opa-fmt: | ||
level: ignore | ||
prefer-snake-case: | ||
# This is the default style preference for Rego, but since | ||
# the style of this project better matches the domain it is | ||
# modeling, we'll ignore this rule in favor of the custom | ||
# naming-convention rule defined above. | ||
level: ignore | ||
rule-length: | ||
level: ignore | ||
todo-comment: | ||
level: ignore | ||
testing: | ||
test-outside-test-package: | ||
# This is just a style preference | ||
level: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.