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

(#34) Implement note rule CPMR0061 - Id Contains "." #49

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

This implements the note rule CPMR0061 that verifies whether a package
uses a dot in its identifier, which is not recommended to do unless
absolutely necessary.

This implementation is more comprehensive than what is implemented in
package validator, where package validator will have false negatives
that this implementation will properly flag.

Motivation and Context

We want to implement as many rules as we can that is currently handled by package validator.

Testing

THis is mostly covered by unit tests, but can be manually verified by

  1. Create a new package with a . in its identifier.
  2. Attempt to run choco pack on the created nuspec file.
  3. Verify the rule CPMR0061 is shown.
  4. Rename the identifier to end with .install, but keep the other . in its identifier.
  5. Attempt to run choco pack on the nuspec file again.
  6. Verify the rule CPMR0061 is shown.
  7. Rename the identifier again to remove the extra . in the identifier, but keep .install.
  8. Attempt to run choco pack on the nuspec file.
  9. Verify the rule CPMR0061 is no longer displayed.

Operating Systems Testing

  • Windows 10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated (no documentation needed to be updated).
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #34

@AdmiringWorm AdmiringWorm requested a review from gep13 June 7, 2024 15:35
@AdmiringWorm AdmiringWorm self-assigned this Jun 7, 2024
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

Just one minor change, and a question in a couple places, otherwise this LGTM, and would be happy to get it merged/released.

This implements the note rule CPMR0061 that verifies whether a package
uses a dot in its identifier, which is not recommended to do unless
absolutely necessary.

This implementation is more comprehensive than what is implemented in
package validator, where package validator will have false negatives
that this implementation will properly flag.
@AdmiringWorm AdmiringWorm requested a review from gep13 July 8, 2024 13:28
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 3450719 into chocolatey-community:develop Jul 8, 2024
1 check passed
@gep13
Copy link
Member

gep13 commented Jul 8, 2024

@AdmiringWorm thanks for getting this added!

@AdmiringWorm AdmiringWorm deleted the 34-rule-cpmr0061 branch July 9, 2024 09:44
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.

Implement note rule CPMR0061 - Id Contains "."
2 participants