chocolatey-community / chocolatey-community-validation

Chocolatey CLI extension to bring community package validation rules to the console
Apache License 2.0
1 stars 4 forks source link

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

Closed AdmiringWorm closed 2 weeks ago

AdmiringWorm commented 1 month ago

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

Change Types Made

Change Checklist

Related Issue

Fixes #34

gep13 commented 2 weeks ago

@AdmiringWorm thanks for getting this added!