Skip to content

Commit

Permalink
refactor: Fix quantified code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
relekang committed Dec 20, 2015
1 parent f0f7937 commit 6d16953
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion semantic_release/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def changelog(**kwargs):
current_version = get_current_version()
log = generate_changelog(get_previous_version(current_version), current_version)
for section in CHANGELOG_SECTIONS:
if len(log[section]) == 0:
if not log[section]:
continue

click.echo(section.capitalize())
Expand Down
4 changes: 2 additions & 2 deletions semantic_release/history/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def set_new_version(new_version):
content = fr.read()

content = re.sub(
r'{} ?= ?["\']\d+\.\d+(?:\.\d+)?["\']'.format(variable),
'{} = \'{}\''.format(variable, new_version),
r'{0} ?= ?["\']\d+\.\d+(?:\.\d+)?["\']'.format(variable),
'{0} = \'{1}\''.format(variable, new_version),
content
)

Expand Down
2 changes: 1 addition & 1 deletion semantic_release/history/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def markdown_changelog(version, changelog, header=False):
output += '## v{0}\n'.format(version)

for section in CHANGELOG_SECTIONS:
if len(changelog[section]) == 0:
if not changelog[section]:
continue

output += '\n### {0}\n'.format(section.capitalize())
Expand Down
2 changes: 1 addition & 1 deletion semantic_release/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _config():
def current_commit_parser():
try:
parts = config.get('semantic_release', 'commit_parser').split('.')
module = '.'.join(parts[:len(parts) - 1])
module = '.'.join(parts[:-1])
return getattr(importlib.import_module(module), parts[-1])
except (ImportError, AttributeError) as error:
raise ImproperConfigurationError('Unable to import parser "{}"'.format(error))

0 comments on commit 6d16953

Please sign in to comment.