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

join strings if they are put onto the same line #61

Closed
RonnyPfannschmidt opened this issue Mar 22, 2018 · 1 comment
Closed

join strings if they are put onto the same line #61

RonnyPfannschmidt opened this issue Mar 22, 2018 · 1 comment

Comments

@RonnyPfannschmidt
Copy link

great job, but i found a nitpick ^^

got:

@@ -49,12 +50,11 @@ def dump_version(root, version, write_to, template=None):
     if template is not None:
         dump = template.format(version=version)
     else:
-        raise ValueError((
-            "bad file format: '%s' (of %s) \n"
-            "only *.txt and *.py are supported") % (
-            os.path.splitext(target)[1],
-            target
-        ))
+        raise ValueError(
+            ("bad file format: '%s' (of %s) \n" "only *.txt and *.py are supported") %
+            (os.path.splitext(target)[1], target)
+        )
+
     with open(target, 'w') as fp:
         fp.write(dump)
 
@@ -70,18 +70,20 @@ def _do_parse(root, parse):
         parse_result = parse(root)
         if isinstance(parse_result, string_types):
             warnings.warn(
-                "version parse result was a string\n"
-                "please return a parsed version",
-                category=DeprecationWarning)
+                "version parse result was a string\n" "please return a parsed version",
+                category=DeprecationWarning,
+            )
             # we use ScmVersion here in order to keep legacy code working
             # for 2.0 we should use meta
             parse_result = ScmVersion(parse_result)
         version = parse_result or _version_from_entrypoint(

expected

@@ -49,12 +50,11 @@ def dump_version(root, version, write_to, template=None):
     if template is not None:
         dump = template.format(version=version)
     else:
-        raise ValueError((
-            "bad file format: '%s' (of %s) \n"
-            "only *.txt and *.py are supported") % (
-            os.path.splitext(target)[1],
-            target
-        ))
+        raise ValueError(
+            ("bad file format: '%s' (of %s) \nonly *.txt and *.py are supported") %
+            (os.path.splitext(target)[1], target)
+        )
+
     with open(target, 'w') as fp:
         fp.write(dump)
 
@@ -70,18 +70,20 @@ def _do_parse(root, parse):
         parse_result = parse(root)
         if isinstance(parse_result, string_types):
             warnings.warn(
-                "version parse result was a string\n"
-                "please return a parsed version",
-                category=DeprecationWarning)
+                "version parse result was a string\nplease return a parsed version",
+                category=DeprecationWarning,
+            )
             # we use ScmVersion here in order to keep legacy code working
             # for 2.0 we should use meta
             parse_result = ScmVersion(parse_result)
         version = parse_result or _version_from_entrypoint(
@carljm
Copy link
Collaborator

carljm commented Mar 22, 2018

This is a duplicate of #26

@carljm carljm closed this as completed Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants