Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Check messageIds in context.report() #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Dec 9, 2024

Prerequisites checklist

What is the purpose of this pull request?

I realized we could easily type check messageId in context.report() if we pass through the MessageIds type from RuleDefinition, so I did that.

What changes did you make? (Give an overview)

Enhancements to RuleContext and related types:

  • Added MessageIds to RuleContextTypeOptions to support custom message identifiers.
  • Simplified the RuleContext interface by using RuleContextTypeOptions directly.
  • Updated the report method in RuleContext to include MessageIds in the ViolationReport type.
  • Enhanced ViolationMessage and ViolationReport types to support custom MessageIds.
  • Included MessageIds in the RuleDefinition context options.

Test updates:

  • Added TestMessageIds type and included it in TestRuleContext to validate the changes in the test suite.

Related Issues

Is there anything you'd like reviewers to focus on?

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Leaving open for a second review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Second Review Needed
Development

Successfully merging this pull request may close these issues.

2 participants