Skip to content

CLOUDP-373281: Move grammaticalWords and ignoreList to shared utility… - #1355

Closed
julius-jogela wants to merge 2 commits into
mainfrom
CLOUDP-373281-move-lists-to-util
Closed

julius-jogela wants to merge 2 commits into
mainfrom
CLOUDP-373281-move-lists-to-util

Conversation

@julius-jogela

Copy link
Copy Markdown
Contributor

Summary

Consolidate grammaticalWords and ignoreList configuration from IPA-126 and IPA-117 rulesets into a shared utility file to eliminate duplication and maintain a single source of truth.

Proposed changes

  • Create new utility file /tools/spectral/ipa/rulesets/functions/utils/grammaticalWordsAndIgnoreList.js with 4 exported constants
  • Update IPA126TagNamesShouldUseTitleCase.js to import from shared utility instead of receiving parameters from YAML
  • Update IPA117OperationSummaryFormat.js to import from shared utility instead of receiving parameters from YAML
  • Remove hardcoded ignoreList and grammaticalWords from IPA-126.yaml and IPA-117.yaml for cleanup

Jira ticket: CLOUDP-373281

Closes CLOUDP-373281

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works (all 696 tests pass)

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

This refactoring reduces code duplication and improves maintainability by:

  1. Keeping both IPA-126 and IPA-117 lists separate (they have different scopes - IPA-126 validates tag names, IPA-117 validates operation summaries)
  2. Centralizing configuration management in one file
  3. Making future updates easier - only need to update one file
  4. All 696 tests pass with no regressions
  5. npm run ipa-validation confirms no errors with the new validation rules

… file

- Create new utility file grammaticalWordsAndIgnoreList.js with shared configuration
- Update IPA-126 and IPA-117 functions to import from shared utility instead of YAML
- Remove hardcoded lists from IPA-126.yaml and IPA-117.yaml for cleanup
- All tests pass: 696 passed, no regressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant