-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Description
When running regal lint . the linter flags an import of a parent-package from a sub-package as "pointless."
I’m unsure if this is intended behavior or a false positive. OPA allows this, however, I understand that this pattern can be discouraged for maintainability reasons.
Is this import pattern considered a bad practice by Regal’s standards?
What is the recommended way to share rules or data between parent and sub-packages?
Linter Output
Rule: pointless-import
Description: Importing own package is pointless
Category: imports
Location: validation/helpers/helpers.rego:3:8
Text: import data.validation
Documentation: https://www.openpolicyagent.org/projects/regal/rules/imports/pointless-importExample
I have the following structure:
└── validation
├── helpers
│ └── helpers.rego
└── validation.rego# validation/helpers/helpers.rego:
package validation.helpers
import data.validation
allowed := false
allowed if {
validation.is_allowed
}# validation/validation.rego:
package validation
is_allowed if {
input != null
input.user == "admin"
}Environment:
- Regal version: 0.37.0
- OPA version: 1.10.1
- OS: macOS 26.1
Metadata
Metadata
Assignees
Labels
No labels