File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,8 +454,9 @@ Improver
454454^^^^^^^^^
455455
456456All the Improvers must inherit from ``Improver `` superclass and implement the
457- ``interesting_advisories `` property and the ``get_inferences `` method, unless they are not improving advisory data.
458- In this case they should override ``is_custom_improver `` property to True and implement the ``run `` method.
457+ ``interesting_advisories `` property and the ``get_inferences `` method,
458+ unless they are not improving advisory data. In this case they should override
459+ ``is_custom_improver `` property to True and implement the ``run `` method.
459460
460461
461462Writing an improver
Original file line number Diff line number Diff line change @@ -120,7 +120,6 @@ class Improver:
120120 def is_custom_improver (cls ):
121121 return False
122122
123-
124123 @classproperty
125124 def qualified_name (cls ):
126125 """
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class CommitRelationImprover(Improver):
2727 """
2828 Detect related commits to an advisory by applying a REGEX.
2929 """
30+
3031 def __init__ (self ):
3132 # using cached insertion for memory efficiency
3233 self .insert_chunk_size = 500
@@ -48,12 +49,12 @@ def interesting_references(self) -> QuerySet:
4849 )
4950
5051 def __generate_instance (self ):
51- commit_pattern = r' (((?P<repo>(https|http):\/\/(bitbucket|github|gitlab)\.(org|com)\/(?P<owner>[^\/]+)\/(?P<project>[^\/]*))\/(commit|commits)\/(?P<hash>\w+)#?)+)'
52+ commit_pattern = r" (((?P<repo>(https|http):\/\/(bitbucket|github|gitlab)\.(org|com)\/(?P<owner>[^\/]+)\/(?P<project>[^\/]*))\/(commit|commits)\/(?P<hash>\w+)#?)+)"
5253 for ref in self .interesting_references :
5354 commit_groups = re .search (commit_pattern , ref .url )
5455 yield Commit (
5556 reference = ref ,
56- hash = commit_groups .group (' hash' ),
57+ hash = commit_groups .group (" hash" ),
5758 )
5859
5960 def __insert_bulk (self ) -> None :
Original file line number Diff line number Diff line change @@ -907,7 +907,7 @@ class Commit(models.Model):
907907 chain_urls = models .JSONField (
908908 default = list ,
909909 help_text = "List of URLS used to reach the commit" ,
910- blank = True ,
910+ blank = True ,
911911 )
912912
913913 class Meta :
You can’t perform that action at this time.
0 commit comments