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

fix: correctly document behavior of --strict-out-of-sync and avoid string typed booleans #779

Merged
merged 3 commits into from
Sep 30, 2019

Conversation

mrackwitz
Copy link
Contributor

@mrackwitz mrackwitz commented Sep 27, 2019

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

Changes the help text to document the default behavior of the --strict-out-of-sync flag and change the options type signature to eliminate the previously present string typed boolean option values "true" | "false".

How should this be manually tested?

The current default behavior was manually verified by @darscan and me, by running snyk test on a project with a lockfile (npm and yarn). Also I verified that the behavior is still the same.

Any background context you want to provide?

This will make it easier to get the CocoaPods plugin working. This failed because it had a stricter options definition, not including string typed booleans:

src/lib/plugins/index.ts:59:7 - error TS2322: Type 'typeof import("/Users/shaun/dev/work/snyk/repos/snyk/node_modules/@snyk/snyk-cocoapods-plugin/dist/index")' is not assignable to type 'Plugin'.
  Types of property 'inspect' are incompatible.
    Type '(root: string, targetFile?: string | undefined, options?: CocoaPodsInspectOptions | undefined) => Promise<SinglePackageResult>' is not assignable to type '(root: string, targetFile: string, options?: Options | undefined) => Promise<InspectResult>'.
      Types of parameters 'options' and 'options' are incompatible.
        Type 'Options | undefined' is not assignable to type 'CocoaPodsInspectOptions | undefined'.
          Type 'Options' is not assignable to type 'CocoaPodsInspectOptions'.
            Types of property 'strictOutOfSync' are incompatible.
              Type 'boolean | "true" | "false" | undefined' is not assignable to type 'boolean | undefined'.
                Type '"true"' is not assignable to type 'boolean | undefined'.

59       return cocoapodsPlugin;

@CLAassistant
Copy link

CLAassistant commented Sep 27, 2019

CLA assistant check
All committers have signed the CLA.

@ghost ghost requested review from lwywoo and orsagie September 27, 2019 15:26
@mrackwitz mrackwitz changed the title fix: remove stringly typed boolean option values fix: correctly document behavior of --strict-out-of-sync and avoid string typed booleans Sep 27, 2019
@mrackwitz mrackwitz force-pushed the fix/remove-stringly-typed-boolean-option-values branch from 8e193c7 to 1efdee3 Compare September 27, 2019 16:17
@darscan darscan merged commit 825666d into master Sep 30, 2019
@darscan darscan deleted the fix/remove-stringly-typed-boolean-option-values branch September 30, 2019 11:56
@snyksec
Copy link

snyksec commented Sep 30, 2019

🎉 This PR is included in version 1.228.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

5 participants