Skip to content

Commit

Permalink
Remove patch as default for untagged history
Browse files Browse the repository at this point in the history
  • Loading branch information
relekang committed Jul 27, 2015
1 parent 4546e1e commit e44e2a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions semantic_release/helpers.py
Expand Up @@ -10,6 +10,8 @@ def get_current_version():


def get_new_version(current_version, level_bump):
if not level_bump:
return current_version
return getattr(semver, 'bump_{0}'.format(level_bump))(current_version)


Expand Down
2 changes: 1 addition & 1 deletion semantic_release/history.py
Expand Up @@ -11,7 +11,7 @@
def evaluate_version_bump(current_version, force=None):
if force:
return force
bump = 'patch'
bump = None

changes = []

Expand Down
3 changes: 3 additions & 0 deletions tests/test_helpers.py
Expand Up @@ -28,3 +28,6 @@ def test_patch_bump(self):
self.assertEqual(get_new_version('0.0.0', 'patch'), '0.0.1')
self.assertEqual(get_new_version('0.1.0', 'patch'), '0.1.1')
self.assertEqual(get_new_version('10.0.9', 'patch'), '10.0.10')

def test_None_bump(self):
self.assertEqual(get_new_version('1.0.0', None), '1.0.0')
3 changes: 2 additions & 1 deletion tests/test_history.py
Expand Up @@ -27,8 +27,9 @@ def test_patch(self):
with mock.patch('semantic_release.history.get_commit_log', lambda: PATCH_COMMIT_MESSAGES):
self.assertEqual(evaluate_version_bump('0.0.0'), 'patch')

def test_nothing_if_no_tag(self):
with mock.patch('semantic_release.history.get_commit_log', lambda: ['', '...']):
self.assertEqual(evaluate_version_bump('0.0.0'), 'patch')
self.assertIsNone(evaluate_version_bump('0.0.0'))

def test_force(self):
self.assertEqual(evaluate_version_bump('0.0.0', 'major'), 'major')
Expand Down

0 comments on commit e44e2a1

Please sign in to comment.