Summary
weaveffi lint surfaces the advisory warnings collected in crates/weaveffi-core/src/validate/warnings.rs, but none of them check identifier casing. The naming conventions in docs/src/reference/naming.md (snake_case for functions and parameters, PascalCase for structs, enums, and interfaces) are currently unenforced, so a stray createItem or kv_error sails through silently even though the per-target generators assume conventional input casing when they re-case identifiers.
Proposed change
Add new ValidationWarning variants to crates/weaveffi-core/src/validate/warnings.rs, for example:
NonSnakeCaseFunction { module, function } for function and parameter names that aren't snake_case
NonPascalCaseType { module, type_name } for struct, enum, interface, and error domain names that aren't PascalCase
Then extend collect_warnings to walk the API and emit them, and add Display messages that tell the user the expected casing (see the existing variants for the message style).
Acceptance criteria
Pointers
- Warning enum and collector:
crates/weaveffi-core/src/validate/warnings.rs
- Existing tests to mimic:
warning_large_enum_variant_count and friends in crates/weaveffi-core/src/validate/tests.rs
- CLI surface:
cmd_lint in crates/weaveffi-cli/src/commands/validate.rs
- Conventions reference:
docs/src/reference/naming.md
Suggested commit message
feat: warn when IDL identifiers don't follow naming conventions
Summary
weaveffi lintsurfaces the advisory warnings collected incrates/weaveffi-core/src/validate/warnings.rs, but none of them check identifier casing. The naming conventions indocs/src/reference/naming.md(snake_case for functions and parameters, PascalCase for structs, enums, and interfaces) are currently unenforced, so a straycreateItemorkv_errorsails through silently even though the per-target generators assume conventional input casing when they re-case identifiers.Proposed change
Add new
ValidationWarningvariants tocrates/weaveffi-core/src/validate/warnings.rs, for example:NonSnakeCaseFunction { module, function }for function and parameter names that aren'tsnake_caseNonPascalCaseType { module, type_name }for struct, enum, interface, and error domain names that aren'tPascalCaseThen extend
collect_warningsto walk the API and emit them, and addDisplaymessages that tell the user the expected casing (see the existing variants for the message style).Acceptance criteria
weaveffi lintwarns on a function namedcreateItemand a struct namedkv_item, with messages that name the offending identifier and the expected conventionsamples/) produce no new warningscrates/weaveffi-core/src/validate/tests.rscover both the warning and the no-warning cases, following the existingwarning_*test pattern#![deny(missing_docs)])Pointers
crates/weaveffi-core/src/validate/warnings.rswarning_large_enum_variant_countand friends incrates/weaveffi-core/src/validate/tests.rscmd_lintincrates/weaveffi-cli/src/commands/validate.rsdocs/src/reference/naming.mdSuggested commit message