zulip / python-zulip-api

Python library for the Zulip API.
https://zulip.com/api/
Apache License 2.0
354 stars 355 forks source link

config file: Add $PWD as default directory. #535

Open orientor opened 4 years ago

orientor commented 4 years ago

The API will first check whether config file exists in the home directory. If not it will take the file from PWD.

This fixes #497

rht commented 4 years ago

There should be a documentation somewhere that needs to be updated to say that $PWD is detected, shouldn't it?

orientor commented 4 years ago

@rht Updated the documentation. Kindly check.

rht commented 4 years ago

@orientor do you know what takes precedence in npm, $PWD or ~? I think it is $PWD but I haven't reconfirm. If that's the case, you might make it to check for $PWD first, instead of ~.

orientor commented 4 years ago

@rht Yes it would make sense for local to have more precedence over global so that I can have different directories for different zulip API uses. npm also does the same, checking the project config file instead of global config if we are in the directory of a project.

orientor commented 4 years ago

@rht changed the precedence accordingly.

rht commented 4 years ago

The commit messages need to end with fullstop as standard in Zulip commits (check out the examples at https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages). Everything else LGTM.

orientor commented 4 years ago

@rht done. Commit messages updated.

zulipbot commented 4 years ago

Heads up @orientor, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

timabbott commented 4 years ago

I'm not convinced we want to make this change; I worry a bit that it'll replace "Have to type a bit more to specify the config" with "confusing behavior where $PWD is important to whether the tool works"