for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import re
import giturlparse
giturlparse
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
from plumbum.cmd import git
plumbum.cmd
from invoke import run
invoke
class PullRequest:
title = None
description = None
author = None
def __init__(self, pr_number, committish):
self.pr_number = pr_number
self.committish = committish
# - keyed
# by
# version
# - status: open, merged
# - issue # => URL
# - title, description
# - author
# - tags
# - (approvers)
#
# - since(version)
pass
def merged_pull_requests():
commit_history = git(
'log --oneline --no-merges --no-color'.split(' ')
).split('\n')
pull_requests = []
for index, commit_msg in enumerate(commit_history):
matches = re.compile(
r'^([0-9a-f]{5,40}) Merge pull request #(\w+)',
).findall(commit_msg)
if matches:
committish, pr_number = matches[0]
pull_requests.append(PullRequest(pr_number, committish))
return pull_requests
class GitRepository:
def __init__(self, url=None):
self.parsed_repo = url or giturlparse.parse(
git('config --get remote.origin.url'.split(' '))
)
self.commit_history = git(
self.pull_requests = merged_pull_requests()
self.tags = git('tag --list'.split(' '))
@property
def repo(self):
return self.parsed_repo.repo
def owner(self):
return self.parsed_repo.owner
def github(self):
return self.parsed_repo.github
def bitbucket(self):
return self.parsed_repo.bitbucket
def __str__(self):
return ''.format(
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.