-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unexpected Behavior of lint-semver-ranges
and list-mismatches
Commands with versionGroup
and semverGroup
Policies in Config
#221
Comments
First of all Angel, I think this might be the best bug report I've ever received 😆 Thank you for all this detail. The timing of this is great actually as I've been struggling a little with what to do about these kinds of things for a long while and it needs nailing down. Questions like what should happen when a semver group is defined but that semver group causes what would otherwise be identical versions to subtly differ – should the version or semver group win out over the other or can they both work together – some scenarios might want the versions to be aligned but then the semver rules to be applied afterwards, others might want the versions to overrule the semver rules, others others might want the semver rules to never be broken. It'll take some time to digest all of this info. I want to incorporate your cases into the test suite, and I think possibly changes to syncpack might be needed to handle different scenarios around whether version or semver groups "win" in different cases, and also some edge cases about what should happen when you run lint vs fix – I won't muddy this issue by going into that though. One thing I can answer right now for one part of it, there are tests that show that pinned versions take precedence. A lot of your questions are still unanswered but I'll get back to you when I can. |
Haha thank you mate. I was previously a Software QA so I've learned how to write good bug reports and now know the value of receiving a good bug report as a Developer 😅. I'm glad you found the amount of detail valuable.
I would imagine trying to please everyone's specific use case would be a hassle. On that note, could things not be simplified to help improve the flexibility of the tool? For instance, could the In addition, if the first matching instance logic were to be dropped, then the policies could be more flexible and reapplied if need be. The order in which rules are applied would now only be left to the expectation of FIFO. Thus things like pinning a version and ensuring All that said, I assume there are reasons for the two rule groups and the first matching instance logic, but I have not taken a look at the source code or the commits so take my thoughts with a grain of salt.
Ahh dope! Thank you mate!
No worries at all mate. I understand its just you maintaining this tool and you probably have your hands full porting it over to |
Description
Note
I created a reproducible repo that includes more details -- https://github.com/ardelato/syncpack-config-ooo-repo/tree/main.
I've encountered unexpected behaviors with
lint-semver-ranges
andlist-mismatches
commands when using a configuration file with bothversionGroup
andsemverGroup
policies.There seems to be an underlying behavior that is not communicated properly or the behavior itself is a bug.
Issues
lint-semver-ranges
Command:Expected: The command should only consider
semverGroup
policies and flag anypeerDependencies
not using the^
range as errors.Actual: Despite only
semverGroup
policies being logged, aPinnedMismatch
type validation is taking into account and marks one of the priorreact
peerDependencies
as valid.list-mismatches
Command:Expected: The command should solely consider
versionGroup
policies for identifying mismatches. For instance, mismatches like thelodash
peerDependency
inpackageB
should not be flagged if they do not fall under anyversionGroup
range definition.Actual: The
lodash
peerDependency
inpackageB
was flagged as an error when usingwithVersionGroup.mjs
, indicating a possible unintended consideration of thesemverGroup
policies.I tried looking at the
syncpack
docs to see if there was any mention that could explain this behavior and only found this - https://jamiemason.github.io/syncpack/guide/getting-started/From this callout, I would still have expected the relevant group's policies to take precedence given the output of the commands.
Overall,
Syncpack
is a very handy tool so if you need further information or help, please let me know!The text was updated successfully, but these errors were encountered: