Skip to content

Added new analyzer to check usage of the RangeAttribute#869

Merged
mikkelbu merged 4 commits intomasterfrom
Issue089_RangeAttribute
May 31, 2025
Merged

Added new analyzer to check usage of the RangeAttribute#869
mikkelbu merged 4 commits intomasterfrom
Issue089_RangeAttribute

Conversation

@manfred-brands
Copy link
Copy Markdown
Member

Fixes #89

Added new analyzer to check usage of the RangeAttribute

  • Checks for '0' step
  • Checks for 'from' <= 'to' when 'step' is positive.
  • Checks for 'from' >= 'to' when 'step' is negative.
  • Checks for matching types between Range arguments and parameter declaration

@manfred-brands manfred-brands force-pushed the Issue089_RangeAttribute branch from 6f22014 to ffe11e9 Compare May 26, 2025 01:07
@manfred-brands manfred-brands requested a review from mikkelbu May 26, 2025 01:08
@mikkelbu mikkelbu added this to the Release 4.9 milestone May 29, 2025
Copy link
Copy Markdown
Member

@mikkelbu mikkelbu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @manfred-brands 🥇. It looks great. I only have some minor comments/questions, but I'm happy to merge it when you are 👍.

Comment thread documentation/NUnit1038.md Outdated
Comment thread src/nunit.analyzers.tests/RangeUsage/RangeUsageAnalyzerTests.cs Outdated
Comment thread src/nunit.analyzers.tests/RangeUsage/RangeUsageAnalyzerTests.cs Outdated
Comment thread src/nunit.analyzers.tests/RangeUsage/RangeUsageAnalyzerTests.cs Outdated
Comment thread src/nunit.analyzers.tests/RangeUsage/RangeUsageAnalyzerTests.cs Outdated
manfred-brands and others added 4 commits May 30, 2025 11:26
* Checks for '0' step
* Checks for 'from' <= 'to' when 'step' is positive.
* Checks for 'from' >= 'to' when 'step' is negative.
* Checks for matching types between Range arguments and parameter declaration
Co-authored-by: Mikkel Nylander Bundgaard <[email protected]>
@manfred-brands manfred-brands force-pushed the Issue089_RangeAttribute branch from bd8287f to 582109c Compare May 30, 2025 04:28
@manfred-brands
Copy link
Copy Markdown
Member Author

Thanks @mikkelbu for your review. All changes applied.

@mikkelbu mikkelbu merged commit 846321a into master May 31, 2025
6 checks passed
@mikkelbu mikkelbu deleted the Issue089_RangeAttribute branch May 31, 2025 10:47
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.

Test the correct usage of the Range attribute

2 participants