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

git remote org name #48

Merged
merged 4 commits into from
Dec 16, 2017
Merged

git remote org name #48

merged 4 commits into from
Dec 16, 2017

Conversation

jayvdb
Copy link
Member

@jayvdb jayvdb commented Dec 14, 2017

Closes #26

community/git.py Outdated

try:
url = giturlparse.parse(url)
except:
Copy link
Collaborator

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.

@jayvdb jayvdb force-pushed the git_remote_org_name branch 2 times, most recently from 9424371 to bd45cda Compare December 14, 2017 21:24
@jayvdb jayvdb force-pushed the git_remote_org_name branch 2 times, most recently from 65edb5c to f6727bf Compare December 15, 2017 02:31
@jayvdb jayvdb mentioned this pull request Dec 16, 2017
@coala coala deleted a comment from gitmate-bot Dec 16, 2017
@coala coala deleted a comment from gitmate-bot Dec 16, 2017
try:
parsed_json = content.json()
except Exception:
return '{}'
Copy link
Member

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())
Copy link
Member

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?

Copy link
Member Author

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:
Copy link
Member

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.

Copy link
Member Author

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')
Copy link
Member

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/excepted as well?

Copy link
Member Author

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

name='twitter',
distill_func=get_index,
distill_file='twitter/index.html',
),
Copy link
Member

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?

name='twitter',
distill_func=get_index,
distill_file='twitter/index.html',
),
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

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

Only except necessary exceptions

parsed_json = content.json()
try:
parsed_json = content.json()
except Exception:
Copy link
Member

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
community/git.py Outdated


def get_owner():
"""Obtain the owner of the repository."""
Copy link
Collaborator

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

@jayvdb jayvdb changed the title Git remote org name git remote org name Dec 16, 2017
@yukiisbored
Copy link
Member

ack 10d6753

@yukiisbored
Copy link
Member

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
@jayvdb
Copy link
Member Author

jayvdb commented Dec 16, 2017

@yukiisbored
Copy link
Member

ack 3ef530f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants