Skip to content

Commit 32e0974

Browse files
akoclaude
andcommitted
fix(check): renumber the menu-icon rule to MDL077, off a collision
MDL074 was assigned twice: validate_navigation_icons.go (a menu item with no icon) and validate_create_shape.go (an unqualified CREATE). Both are live and both emit, so suppressing or looking up either by id hits the other. Two PRs each read the highest assigned id and took the next one, independently, before either merged. MDL075 (void-with-alias) and MDL076 (ON ERROR CONTINUE where Mendix refuses it) are taken as well, so the menu-icon rule moves to MDL077 -- create-shape keeps MDL074, having the wider blast radius in scripts and docs already written against it. Verified with a control rather than by grep, since a single rule legitimately emits from several sites and a naive count cannot tell that from a collision: the untouched repro (every item iconed) reports 0 rule hits, the same file with two icons removed reports exactly 2 x MDL077, and the unqualified-CREATE probe still reports MDL074 alone. Nothing in the build catches a duplicate rule id; that guard does not exist yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent db6ccc4 commit 32e0974

9 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎.claude/skills/mendix/manage-navigation/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ create or replace navigation Responsive
119119
### Menu Icons
120120

121121
**Give every menu item an icon.** It is optional in the grammar and `mxcli check`
122-
warns when it is missing (**MDL074**), because the navigation sidebar collapses
122+
warns when it is missing (**MDL077**), because the navigation sidebar collapses
123123
to an icon rail and that is the state most users leave it in: a collapsed item
124124
shows its icon, and one without falls back to the first few characters of its
125125
caption — rarely enough to tell `Orders` from `Order lines`. Nothing else catches

‎docs/01-project/MDL_QUICK_REFERENCE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ create or replace navigation Responsive
775775
);
776776
```
777777

778-
**An item with no icon is reported (MDL074, a warning).** The navigation sidebar
778+
**An item with no icon is reported (MDL077, a warning).** The navigation sidebar
779779
collapses to an icon rail, and that is the state most users leave it in: a
780780
collapsed item shows its icon, and one without falls back to the first few
781781
characters of its caption — rarely enough to tell `Orders` from `Order lines`.

‎mdl-examples/bug-tests/navigation-menu-item-icons.mdl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- ============================================================================
2-
-- MDL074: a navigation menu item with no icon is reported
2+
-- MDL077: a navigation menu item with no icon is reported
33
-- ============================================================================
44
--
55
-- The navigation sidebar collapses to an icon rail, and that is the state most
@@ -11,7 +11,7 @@
1111
-- This script is a POSITIVE example — every item carries an icon, so it checks
1212
-- clean. The warning it guards against is exercised by the unit tests in
1313
-- mdl/executor/validate_navigation_icons_test.go, which can assert the absence
14-
-- of a warning as well as its presence; a `.fail.mdl` cannot, because MDL074 is
14+
-- of a warning as well as its presence; a `.fail.mdl` cannot, because MDL077 is
1515
-- a WARNING and `check` still exits 0.
1616
--
1717
-- The rule needs no project, so it fires under `make check-mdl` too.

‎mdl/executor/validate_navigation_icons.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/mendixlabs/mxcli/mdl/types"
1111
)
1212

13-
// validateMenuItemIcons (MDL074) flags a navigation menu item that specifies no
13+
// validateMenuItemIcons (MDL077) flags a navigation menu item that specifies no
1414
// icon.
1515
//
1616
// # Why this is worth a warning
@@ -68,7 +68,7 @@ func validateMenuItemIcons(stmt ast.Statement) []linter.Violation {
6868
// kind, which is what the writer and DESCRIBE also read.
6969
if item.IconKind == types.MenuIconNone {
7070
out = append(out, linter.Violation{
71-
RuleID: "MDL074",
71+
RuleID: "MDL077",
7272
Severity: linter.SeverityWarning,
7373
Message: fmt.Sprintf(
7474
"%s: menu item %q specifies no icon — a collapsed navigation sidebar "+

‎mdl/executor/validate_navigation_icons_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func navIconWarnings(vs []linter.Violation) []linter.Violation {
1515
var out []linter.Violation
1616
for _, v := range vs {
17-
if v.RuleID == "MDL074" {
17+
if v.RuleID == "MDL077" {
1818
out = append(out, v)
1919
}
2020
}
@@ -140,7 +140,7 @@ func TestValidateMenuItemIcons_RunsWithoutAProject(t *testing.T) {
140140
},
141141
}}
142142
if got := navIconWarnings(ValidateProgram(prog, "")); len(got) != 1 {
143-
t.Errorf("got %d MDL074 from ValidateProgram with no project, want 1: %+v", len(got), got)
143+
t.Errorf("got %d MDL077 from ValidateProgram with no project, want 1: %+v", len(got), got)
144144
}
145145
}
146146

‎mdl/executor/validate_program.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func ValidateProgram(prog *ast.Program, projectPath string) []linter.Violation {
5353
violations = append(violations, ValidateUserRoleSystemModuleRole(roleStmt, securityEnabled)...)
5454
}
5555
// A navigation menu item with no icon is unreadable once the sidebar is
56-
// collapsed to its icon rail (MDL074). Covers both statements that carry
56+
// collapsed to its icon rail (MDL077). Covers both statements that carry
5757
// menu items, which share one AST node so they cannot diverge.
5858
violations = append(violations, validateMenuItemIcons(stmt)...)
5959
// A page with parameters and a Url must name each parameter in it (CE5601).

‎mdl/types/navigation.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type NavMenuItem struct {
7171
// HasIcon reports whether the item carries an icon of ANY of the three kinds.
7272
//
7373
// Not `Icon != ""`: a glyph icon has a numeric code and no name, so the obvious
74-
// test calls an item with a perfectly good icon iconless. MDL074 asks this
74+
// test calls an item with a perfectly good icon iconless. MDL077 asks this
7575
// question, and asking it the obvious way would have made the rule fire on every
7676
// Studio Pro-authored menu.
7777
func (m *NavMenuItem) HasIcon() bool {

‎mdl/types/navigation_icon_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "testing"
66

77
// A menu item's icon is one of three Mendix elements, and mxcli could name only
88
// one of them. MenuIconKindOf maps the storage $Type onto a vocabulary so the
9-
// readers, the writers, DESCRIBE and MDL074 all decide the same way instead of
9+
// readers, the writers, DESCRIBE and MDL077 all decide the same way instead of
1010
// each doing its own strings.HasSuffix.
1111
func TestMenuIconKindOf(t *testing.T) {
1212
cases := []struct {
@@ -52,7 +52,7 @@ func TestMenuIconStorageType(t *testing.T) {
5252
}
5353
}
5454

55-
// HasIcon is what MDL074 asks. A glyph icon carries a numeric code and NO name,
55+
// HasIcon is what MDL077 asks. A glyph icon carries a numeric code and NO name,
5656
// so a check written as `Icon == ""` reports an item that plainly has an icon.
5757
func TestNavMenuItemHasIcon(t *testing.T) {
5858
cases := []struct {

‎mdl/visitor/visitor_navigation_icon_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func TestNavMenuItem_BareIconIsStillACollectionIcon(t *testing.T) {
163163
}
164164
}
165165

166-
// An item with no icon at all keeps the zero kind, which is what MDL074 reads.
166+
// An item with no icon at all keeps the zero kind, which is what MDL077 reads.
167167
func TestNavMenuItem_NoIconIsKindNone(t *testing.T) {
168168
items := navMenuItems(t, `MENU ITEM 'Home' PAGE M.Home;`)
169169
if items[0].IconKind != types.MenuIconNone {

0 commit comments

Comments
 (0)