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

Output more info for syncpack lint #134

Closed
glomotion opened this issue May 31, 2023 · 3 comments
Closed

Output more info for syncpack lint #134

glomotion opened this issue May 31, 2023 · 3 comments

Comments

@glomotion
Copy link

glomotion commented May 31, 2023

Description

I'm currently implementing syncpack into our monorepo, and want to run it's syncpack lint command inside our cicd to checkover PR code.

currently, when we run syncpack lint, it exits with 1 and the following:

> syncpack lint

-   7 package.json files
- 127 total dependences
-  55 in package.dependencies
-  70 in package.devDependencies
-   2 in package.version
Version mismatches
-  73 are valid
-   0 should have matching versions (prefer highest semver)
-   0 should have matching versions (prefer lowest semver)
-   0 should match workspace package version
-   0 are banned from use
-   0 should be pinned to a specific version
-   0 should snap to version used by another package
-   0 are filtered out
-   0 are ignored
-   0 have unsupported version format
Semver range mismatches
- 124 are valid
-   0 should use specific semver range
-   0 should use exact version in version property of package.json
-   0 are filtered out
-   0 are ignored
-   3 have unsupported version format

i'm guessing it's exiting with 1 because of the 3 have unsupported version format but I have NFI what/where these are or how to fix them. Thus, this lint check isnt all that helpful RN. :(

Suggested Solution

Output details of the "3 have unsupported version format" items - so that we're able to fix them.

@JamieMason
Copy link
Owner

The lint command is only 2 days old and thanks for checking it out, your feedback helps improve it.

Until now most people have been using both https://jamiemason.github.io/syncpack/lint-semver-ranges and https://jamiemason.github.io/syncpack/list-mismatches which do the same checks but with more detailed output.

I would use those for now and then let me know based on the other commands what kind of output would be best in your opinion for the new combined lint command. list is less verbose than list-mismatches for example, but also exits with an error code when needed.

@glomotion
Copy link
Author

glomotion commented May 31, 2023

So yeah i assumed as much, and have swapped over to using list-mismatches just for now. 😁

So just out of interest, when i run: npx syncpack lint-semver-ranges - i get zero output but it still exits as 1. 🤔 Is this expected?

Screenshot 2023-05-31 at 3 11 28 pm

@JamieMason
Copy link
Owner

JamieMason commented May 31, 2023

Looks like a bug are you able to share the output of syncpack list? the fact that they're unsupported version formats should be enough to trace this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants