-
Notifications
You must be signed in to change notification settings - Fork 45
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
git remote org name #48
Conversation
Related to coala#40
community/git.py
Outdated
|
||
try: | ||
url = giturlparse.parse(url) | ||
except: |
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.
E722 do not use bare except'
Origin: PycodestyleBear (E722), Section: all.autopep8
.
9424371
to
bd45cda
Compare
65edb5c
to
f6727bf
Compare
activity/scraper.py
Outdated
try: | ||
parsed_json = content.json() | ||
except Exception: | ||
return '{}' |
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.
Should this be returned as an HttpResponse
?
community/git.py
Outdated
def get_config_remote(name='origin'): | ||
config = get_config() | ||
|
||
print(config.sections()) |
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.
Is there a reason for this to be printing or is this just debug code?
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.
whoops!
community/git.py
Outdated
|
||
def get_remote_url(): | ||
url = os.environ.get('REPOSITORY_URL') | ||
if not url: |
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.
os.environ.get
returns None if it doesn't exist, so if url is None:
might be better.
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.
but if someone has done REPOSITORY_URL=''
... :P
community/git.py
Outdated
try: | ||
url = giturlparse.parse(url) | ||
except Exception: | ||
url = giturlparse.parse(url + '.git') |
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.
Does this need to be try/except
ed as well?
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.
No, the try/except was to workaround retr0h/git-url-parse#2
community/urls.py
Outdated
name='twitter', | ||
distill_func=get_index, | ||
distill_file='twitter/index.html', | ||
), |
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.
Why is this being moved?
community/urls.py
Outdated
name='twitter', | ||
distill_func=get_index, | ||
distill_file='twitter/index.html', | ||
), |
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.
This shouldn't get moved.
community/git.py
Outdated
|
||
try: | ||
url = giturlparse.parse(url) | ||
except Exception: |
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.
Only except
necessary exceptions
activity/scraper.py
Outdated
parsed_json = content.json() | ||
try: | ||
parsed_json = content.json() | ||
except Exception: |
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.
except
only necessary exceptions.
A version conflict occurs when coala-bears is installed last, as pip installs click 6.7 while bears requires click 6.6
ad7b087
to
b34e83c
Compare
community/git.py
Outdated
|
||
|
||
def get_owner(): | ||
"""Obtain the owner of the repository.""" |
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.
You do not use the preferred quotation marks.
Origin: QuotesBear, Section: all.python
.
The issue can be fixed by applying the following patch:
--- a/tmp/tmp5tcc9gcw/community/git.py
+++ b/tmp/tmp5tcc9gcw/community/git.py
@@ -61,6 +61,6 @@
def get_owner():
- """Obtain the owner of the repository."""
+ '""Obtain the owner of the repository.""'
url = get_remote_url()
return url.owner
b34e83c
to
5c5dd1a
Compare
ack 10d6753 |
5c5dd1a
to
3ef530f
Compare
ack 1354386 |
Replace orgname.sh with community/git.py, which provides get_owner that is implemented in the twitter and activity modules. Closes coala#26
ack 3ef530f |
Closes #26