Skip to content

Improve how we handle results to show messages#1493

Merged
henriquemoody merged 4 commits intoRespect:mainfrom
henriquemoody:core/messages
Dec 13, 2024
Merged

Improve how we handle results to show messages#1493
henriquemoody merged 4 commits intoRespect:mainfrom
henriquemoody:core/messages

Conversation

@henriquemoody
Copy link
Member

The way we display messages could have been better, and it took me a while to realise that to make it better, I would need to handle the siblings of a result before deciding whether we should render it.

Another issue was that rules like Key and Property had to create a "dumb" parent just so we would display the messages correctly, and in some cases, that wasn't even enough.

This commit introduces quite a few changes to how the library works, making the messages much more straightforward.

That way, it will be easier to look for those tests, and the root
directory will be cleaner.
With the "exceptionAll()" function, we can then have the single message,
the full message, and the messages as an array. That makes it harder to
get those bugs back.
The name "subsequent" better represents those results. What I would
consider a "sibling" would be another child from the same result.
@henriquemoody henriquemoody added this to the 3.0 milestone Dec 13, 2024
@codecov
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.34%. Comparing base (2485d54) to head (82cb05b).
Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1493      +/-   ##
============================================
+ Coverage     97.24%   97.34%   +0.10%     
- Complexity      953      958       +5     
============================================
  Files           199      199              
  Lines          2319     2334      +15     
============================================
+ Hits           2255     2272      +17     
+ Misses           64       62       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The way we display messages could have been better, and it took me a
while to realise that to make it better, I would need to handle the
siblings of a result before deciding whether we should render it.

Another issue was that rules like Key and Property had to create a
"dumb" parent just so we would display the messages correctly, and in
some cases, that wasn't even enough.

This commit introduces quite a few changes to how the library works,
making the messages much more straightforward.
@henriquemoody henriquemoody merged commit 82cb05b into Respect:main Dec 13, 2024
@henriquemoody henriquemoody deleted the core/messages branch December 13, 2024 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant