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

Make periphery return non-zero exit code on warnings #22

Closed
Jeehut opened this issue Feb 21, 2019 · 4 comments
Closed

Make periphery return non-zero exit code on warnings #22

Jeehut opened this issue Feb 21, 2019 · 4 comments

Comments

@Jeehut
Copy link
Contributor

Jeehut commented Feb 21, 2019

I'd like to configure Periphery on our CI and configured everything like this (see our template project):

project: NewProjectTemplate.xcodeproj
schemes: [App]
targets: [App, Tests, UITests]
report_exclude:
  - App/Generated/SwiftGen/*.swift
  - App/SupportingFiles/*.swift
retain_public: false
quiet: true

But when I run periphery scan on the CI the builds always succeed even when I willingly add some unused code to test if the CI is failing. This is due to there being no option to make periphery return with a non-zero exit code for warnings (I don't know if it even returns with 0 on errors) – but for our purpose it would be grate to have an option like fail_on_warnings or -f or -w when calling the executable so this works.

@Jeehut
Copy link
Contributor Author

Jeehut commented Feb 21, 2019

I just posted a PR with a basic implementation for this. Feel free to give feedback.

@Jeehut
Copy link
Contributor Author

Jeehut commented Feb 21, 2019

I just removed the original periphery on my device

brew remove periphery -f

and installed my fork using Mint (can take a while)

mint install Dschee/periphery@fail-on-warnings

and tested my implementation adding this to the configuration file

fail_on_warnings: true

and it worked just as expected! 🎉

@ileitch
Copy link
Contributor

ileitch commented Feb 21, 2019

I don't know if it even returns with 0 on errors

It returns 1 for errors, Commandant handles that.

@Jeehut
Copy link
Contributor Author

Jeehut commented Feb 22, 2019

Implemented via #23.

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

No branches or pull requests

2 participants