From c8c40403bf329d0db25be810151a67a4d0d65214 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 17 Sep 2026 08:11:57 +0000 Subject: [PATCH] docs(lint): correct field value formats in write-lint-rules skill The reference documented three values that do not match what the runtime returns. Each mismatch makes a rule match nothing and report a clean pass, which is indistinguishable from the project being healthy. - entity_type is normalised to Persistent/NonPersistent/View in LintContext.Entities (context.go CASE), not lower case. The SEC001 example rule in this document used "persistent" and so matched no entity at all. - permission.access_type is written upper case by builder_permissions.go (CREATE/READ/WRITE/DELETE/EXECUTE/VIEW/ACCESS/MEMBER_READ/MEMBER_WRITE). - permission.module_role_name is qualified (Sales.Admin), which matters because rules compare it against user_role.module_roles. --- .claude/skills/mendix/write-lint-rules/SKILL.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.claude/skills/mendix/write-lint-rules/SKILL.md b/.claude/skills/mendix/write-lint-rules/SKILL.md index 99eccf45bb..e4082452a7 100644 --- a/.claude/skills/mendix/write-lint-rules/SKILL.md +++ b/.claude/skills/mendix/write-lint-rules/SKILL.md @@ -127,7 +127,7 @@ def check(): | `qualified_name` | string | `"Sales.Customer"` | | `module_name` | string | `"Sales"` | | `folder` | string | `"DomainModel"` — folder path within module | -| `entity_type` | string | `"persistent"`, `"NonPersistent"`, `"view"` | +| `entity_type` | string | `"Persistent"`, `"NonPersistent"`, `"View"` — normalised from the catalog's `PERSISTENT`/`NON_PERSISTENT`/`VIEW` | | `description` | string | Documentation text | | `generalization` | string | Parent entity qualified name | | `attribute_count` | int | Number of attributes | @@ -327,12 +327,12 @@ Returned by `permissions()` (all types) or `permissions_for()` (entity-specific) | Property | Type | Example | |----------|------|---------| -| `module_role_name` | string | `"Admin"` | +| `module_role_name` | string | `"Sales.Admin"` — qualified, so it compares directly against `user_role.module_roles` | | `element_type` | string | `"entity"`, `"microflow"`, `"page"`, `"ODATA_SERVICE"` (from `permissions()` only) | | `element_name` | string | `"Sales.Customer"` | | `module_name` | string | `"Sales"` | | `entity_name` | string | `"Sales.Customer"` (from `permissions_for()` only) | -| `access_type` | string | `"create"`, `"read"`, `"write"`, `"delete"`, `"execute"`, `"view"`, `"access"`, `"MEMBER_READ"`, `"MEMBER_WRITE"` | +| `access_type` | string | `"CREATE"`, `"READ"`, `"WRITE"`, `"DELETE"`, `"EXECUTE"`, `"VIEW"`, `"ACCESS"`, `"MEMBER_READ"`, `"MEMBER_WRITE"` — always upper case | | `member_name` | string | Attribute name (for MEMBER_READ/MEMBER_WRITE) | | `xpath_constraint` | string | XPath constraint or empty | | `is_constrained` | bool | True if XPath constraint is set | @@ -416,7 +416,7 @@ SEVERITY = "warning" def check(): violations = [] for e in entities(): - if e.entity_type == "persistent" and not e.is_external and e.access_rule_count == 0: + if e.entity_type == "Persistent" and not e.is_external and e.access_rule_count == 0: violations.append(violation( message="persistent entity '{}' has no access rules".format(e.qualified_name), location=location(module=e.module_name, document_type="entity", document_name=e.name),