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
Dschee opened this issue Feb 21, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@Dschee
Copy link
Contributor

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.

@Dschee

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2019

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

@Dschee

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2019

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

It returns 1 for errors, Commandant handles that.

@Dschee

This comment has been minimized.

Copy link
Contributor Author

commented Feb 22, 2019

Implemented via #23.

@Dschee Dschee closed this Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.