Skip to content

Commit

Permalink
travis add pylint-exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sirfoga committed Oct 12, 2018
1 parent a3db714 commit f926b4d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ script:
- "make show-installed-version"
- "# pytest --cov=./" # test coverage
- "# codecov"
- "pylint -j 8 hal/*" # measure code lint
- "pylint -j 8 hal/* | pylint-exit $?" # measure code lint
notifications:
email: "false" # no email notify
cache: "pip"
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.2.3 (485977a98aeb85b3119ab19325fd4be472b3d71b)
10.2.3 (34f0d20ff32c83e98542a13dd2aaac754946dfb4)
2 changes: 1 addition & 1 deletion hal/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__description__ = 'Your swiss knife to perform fast and easy pythonic stuff'
__url__ = 'https://sirfoga.github.io/pyhal/'
__version__ = '10.2.3'
__build__ = '485977a98aeb85b3119ab19325fd4be472b3d71b'
__build__ = '34f0d20ff32c83e98542a13dd2aaac754946dfb4'
__author__ = 'Stefano Fogarollo'
__author_email__ = 'sirfoga@protonmail.com'
__license__ = 'MIT'
Expand Down
20 changes: 18 additions & 2 deletions hal/cvs/gits.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_diff_amounts(self):
last_commit = None
for commit in self.repo.iter_commits():
if last_commit is not None:
diff = self.get_diff(commit, last_commit)
diff = self.get_diff(commit.hexsha, last_commit.hexsha)
total_changed = diff[Diff.ADD] + diff[Diff.DEL]
diffs.append(total_changed)

Expand All @@ -128,7 +128,7 @@ def get_diff(self, commit, other_commit):
:param other_commit: Second commit
:return: dictionary: Dictionary with total additions and deletions
"""
diff = self.repo.git.diff(commit.hexsha, other_commit.hexsha)
diff = self.repo.git.diff(commit, other_commit)
return Diff(diff).get_totals()

def get_version(self, diff_to_increase_ratio):
Expand All @@ -145,6 +145,22 @@ def get_version(self, diff_to_increase_ratio):

return version

def get_new_version(self, last_version, last_commit,
diff_to_increase_ratio):
"""Gets new version
:param last_version: last version known
:param last_commit: hash of commit of last version
:param diff_to_increase_ratio: Ratio to convert number of changes into
:return: new version
"""

version = Version(last_version)
diff = self.get_diff(last_commit, self.get_last_commit_hash())

version.increase_by_changes(diff, diff_to_increase_ratio)
return version

def get_pretty_version(self, diff_to_increase_ratio):
"""Pretty version
Expand Down
1 change: 0 additions & 1 deletion hal/internet/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import re
import time
import urllib.request
import webbrowser
from urllib.parse import urljoin

import requests
Expand Down

0 comments on commit f926b4d

Please sign in to comment.