-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add '--continuous' check when '--notifications' enabled #93
Add '--continuous' check when '--notifications' enabled #93
Conversation
camply/cli.py
Outdated
if kwargs.get('notifications') and not kwargs.get('continuous'): | ||
logger.error( | ||
"To search with --notifications enabled, Camply must be run " | ||
"in --continuous mode." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept of "continuous" mode isn't established elsewhere, is there a better way to phrase this?
camply/cli.py
Outdated
|
||
if kwargs.get('notifications') and not kwargs.get('continuous'): | ||
logger.error( | ||
"To search with --notifications enabled, Camply must be run " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would "To search campgrounds with..." be clearer?
Should errors messages use the full parameter notation, i.e. --notifications
, or simply parameter names, i.e notifications
. I personally prefer the former, but want error messaging to be consistent throughout the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I like something like: To receive notifications about campsites you must be searching continuously by passing the --continuous
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the mentioning of the full CLI arguments with the leading dashes
Sorry to be a formatting bug here, would you make sure the code is being formatted with pre-commit as well? https://juftin.com/camply/contributing.html Maybe I should put this info on the GitHub too? |
Sure thing. Do you have any guidelines on when to add tests as well? This is a pretty simple PR, but it wouldn't be unreasonable to ask for additional test coverage over the new behavior. |
I'm not terribly worried about a test for this change here. In general, camply has pretty poor test coverage. I have a number of command line tests that run inside the tox I'd like to improve this in the future but I can't be a stickler for it in the meantime. I've implemented a lot more without a new test. |
070356e
to
f839755
Compare
f839755
to
fe403eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
If
--notifications
is provided without--continuous
, it acts as a no-op, which can be confusing if you're testing notifications and don't realize that camply must be in continuous mode for notifications to be enabled.Block on #92