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

no exit code as counter #44

Merged
merged 4 commits into from
May 1, 2023
Merged

Conversation

DMyachin
Copy link
Contributor

@DMyachin DMyachin commented Feb 17, 2023

Added flag --no-exit-counter that allows get exit code 0 if no any errors appears.

@DMyachin DMyachin closed this Feb 17, 2023
@DMyachin DMyachin reopened this Feb 17, 2023
@DMyachin
Copy link
Contributor Author

#34

@pnu-s pnu-s self-requested a review February 17, 2023 16:45
Copy link
Member

@pnu-s pnu-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Tested it locally and it works as expected.

I made a couple of comments/questions

exodus_analyze.py Outdated Show resolved Hide resolved
exodus_analyze.py Outdated Show resolved Hide resolved
@DMyachin DMyachin requested a review from pnu-s March 9, 2023 17:55
@DMyachin
Copy link
Contributor Author

DMyachin commented Apr 7, 2023

@pnu-s ?

@pnu-s
Copy link
Member

pnu-s commented May 1, 2023

Sorry for the delayed answer!

My proposal was not just to use the exit-code name rather than no-exit-code but to offer the user to specify its error code (0 to avoid failing totally, 1 to overwrite the current behavior which returns the number of trackers, or other)

That would improve the user experience in my opinion

In terms of code, it would mean:

  • if no trackers, always return 0
  • if trackers, either return the specified exit code if existing otherwise the number of trackers as a RC

@DMyachin
Copy link
Contributor Author

DMyachin commented May 1, 2023

See new commit

    if all([counter, forced_code is not None]):
        sys.exit(forced_code)
    sys.exit(counter)

0 is False in Python.

If counter is not zero (has trackers) AND code overwriting is set to any int value, the value will be used else counter.

@pnu-s
Copy link
Member

pnu-s commented May 1, 2023

LGTM, thanks for your quick changes!

You'll just need to remove that extra blank line to make the linter pass, and I'll be able to merge it 🚀

@pnu-s pnu-s merged commit ec04052 into Exodus-Privacy:master May 1, 2023
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

Successfully merging this pull request may close these issues.

2 participants