Patchwork [09,of,12,topics] flake8: fix E501 style

login
register
mail settings
Submitter Sean Farley
Date Aug. 31, 2016, 3:58 a.m.
Message ID <4f3c71461d1b799bb26a.1472615895@laptop.local>
Download mbox | patch
Permalink /patch/16510/
State Accepted
Headers show

Comments

Sean Farley - Aug. 31, 2016, 3:58 a.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1472595675 25200
#      Tue Aug 30 15:21:15 2016 -0700
# Node ID 4f3c71461d1b799bb26a4409d22eb6a458cb9d44
# Parent  fbceb43849d91459925dabb8c5f1683744ec320b
# EXP-Topic flake8
flake8: fix E501 style

My favorite of them all.
Anton Shestakov - Aug. 31, 2016, 5:24 a.m.
On Tue, 30 Aug 2016 20:58:15 -0700
Sean Farley <sean@farley.io> wrote:

> diff --git a/hgext3rd/topic/evolvebits.py b/hgext3rd/topic/evolvebits.py
> --- a/hgext3rd/topic/evolvebits.py
> +++ b/hgext3rd/topic/evolvebits.py
> @@ -40,14 +40,13 @@ def _orderrevs(repo, revs):
>  
>  def builddependencies(repo, revs):
>      """returns dependency graphs giving an order to solve instability of revs
>      (see _orderrevs for more information on usage)"""
>  
> -    # For each troubled revision we keep track of what instability if any should
> -    # be resolved in order to resolve it. Example:
> -    # dependencies = {3: [6], 6:[]}
> -    # Means that: 6 has no dependency, 3 depends on 6 to be solved
> +    # For each troubled revision we keep track of what instability if any
> +    # should be resolved in order to resolve it. Example: dependencies = {3:
> +    # [6], 6:[]} Means that: 6 has no dependency, 3 depends on 6 to be solved
>      dependencies = {}
>      # rdependencies is the inverted dict of dependencies
>      rdependencies = collections.defaultdict(set)

I would say line breaks in the original version help readability.
Pierre-Yves David - Sept. 6, 2016, 11:45 a.m.
On 08/31/2016 07:24 AM, Anton Shestakov wrote:
> On Tue, 30 Aug 2016 20:58:15 -0700
> Sean Farley <sean@farley.io> wrote:
>
>> diff --git a/hgext3rd/topic/evolvebits.py b/hgext3rd/topic/evolvebits.py
>> --- a/hgext3rd/topic/evolvebits.py
>> +++ b/hgext3rd/topic/evolvebits.py
>> @@ -40,14 +40,13 @@ def _orderrevs(repo, revs):
>>
>>  def builddependencies(repo, revs):
>>      """returns dependency graphs giving an order to solve instability of revs
>>      (see _orderrevs for more information on usage)"""
>>
>> -    # For each troubled revision we keep track of what instability if any should
>> -    # be resolved in order to resolve it. Example:
>> -    # dependencies = {3: [6], 6:[]}
>> -    # Means that: 6 has no dependency, 3 depends on 6 to be solved
>> +    # For each troubled revision we keep track of what instability if any
>> +    # should be resolved in order to resolve it. Example: dependencies = {3:
>> +    # [6], 6:[]} Means that: 6 has no dependency, 3 depends on 6 to be solved
>>      dependencies = {}
>>      # rdependencies is the inverted dict of dependencies
>>      rdependencies = collections.defaultdict(set)
>
> I would say line breaks in the original version help readability.

That looks like a very legit feedback, can you resend a version without 
this issue ? thanks.

Patch

diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py
+++ b/hgext3rd/topic/__init__.py
@@ -174,11 +174,12 @@  def reposetup(ui, repo):
         def destroyed(self, *args, **kwargs):
             with topicmap.usetopicmap(self):
                 return super(topicrepo, self).destroyed(*args, **kwargs)
 
         def invalidatevolatilesets(self):
-            # XXX we might be able to move this to something invalidated less often
+            # XXX we might be able to move this to something invalidated less
+            # often
             super(topicrepo, self).invalidatevolatilesets()
             self._topics = None
             if '_topiccaches' in vars(self.unfiltered()):
                 self.unfiltered()._topiccaches.clear()
 
@@ -217,11 +218,12 @@  def topics(ui, repo, topic='', clear=Fal
 
     if change:
         if not obsolete.isenabled(repo, obsolete.createmarkersopt):
             raise error.Abort(_('must have obsolete enabled to use --change'))
         if not topic and not clear:
-            raise error.Abort('changing topic requires a topic name or --clear')
+            raise error.Abort('changing topic requires a topic name or '
+                              '--clear')
         if any(not c.mutable() for c in repo.set('%r and public()', change)):
             raise error.Abort("can't change topic of a public change")
         rewrote = 0
         needevolve = False
         l = repo.lock()
@@ -321,11 +323,12 @@  def _listtopics(ui, repo, opts):
         if ui.verbose:
             # XXX we should include the data even when not verbose
             data = stack.stackdata(repo, topic)
             fm.plain(' (')
             fm.write('branches+', 'on branch: %s',
-                     '+'.join(data['branches']), # XXX use list directly after 4.0 is released
+                     # XXX use list directly after 4.0 is released
+                     '+'.join(data['branches']),
                      label='topic.list.branches')
             fm.plain(', ')
             fm.write('changesetcount', '%d changesets', data['changesetcount'],
                      label='topic.list.changesetcount')
             if data['troubledcount']:
diff --git a/hgext3rd/topic/evolvebits.py b/hgext3rd/topic/evolvebits.py
--- a/hgext3rd/topic/evolvebits.py
+++ b/hgext3rd/topic/evolvebits.py
@@ -40,14 +40,13 @@  def _orderrevs(repo, revs):
 
 def builddependencies(repo, revs):
     """returns dependency graphs giving an order to solve instability of revs
     (see _orderrevs for more information on usage)"""
 
-    # For each troubled revision we keep track of what instability if any should
-    # be resolved in order to resolve it. Example:
-    # dependencies = {3: [6], 6:[]}
-    # Means that: 6 has no dependency, 3 depends on 6 to be solved
+    # For each troubled revision we keep track of what instability if any
+    # should be resolved in order to resolve it. Example: dependencies = {3:
+    # [6], 6:[]} Means that: 6 has no dependency, 3 depends on 6 to be solved
     dependencies = {}
     # rdependencies is the inverted dict of dependencies
     rdependencies = collections.defaultdict(set)
 
     for r in revs:
diff --git a/hgext3rd/topic/stack.py b/hgext3rd/topic/stack.py
--- a/hgext3rd/topic/stack.py
+++ b/hgext3rd/topic/stack.py
@@ -38,14 +38,16 @@  def showstack(ui, repo, topic, opts):
     fm.plain(_('### branch: %s')
              % '+'.join(data['branches']), # XXX handle multi branches
              label='topic.stack.summary.branches')
     if data['behindcount'] == -1:
         fm.plain(', ')
-        fm.plain('ambigious rebase destination', label='topic.stack.summary.behinderror')
+        fm.plain('ambigious rebase destination',
+                 label='topic.stack.summary.behinderror')
     elif data['behindcount']:
         fm.plain(', ')
-        fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
+        fm.plain('%d behind' % data['behindcount'],
+                 label='topic.stack.summary.behindcount')
     fm.plain('\n')
 
     for idx, r in enumerate(getstack(repo, topic), 1):
         ctx = repo[r]
         p1 = ctx.p1()
diff --git a/setup.cfg b/setup.cfg
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,2 @@ 
 [flake8]
-ignore = E261, E266, E302, E129, E731, E124, E713, E301, E501
+ignore = E261, E266, E302, E129, E731, E124, E713, E301