From 7799c9a856ccc7af0c6e0edab9828d791e3fa303 Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Wed, 26 Feb 2020 12:55:27 +0100
Subject: [PATCH] prevent too long line, format the few line too long

---
 ippisite/.flake8                                              | 3 ++-
 ippisite/ippidb/admin.py                                      | 4 +++-
 .../ippidb/management/commands/compute_compound_properties.py | 3 ++-
 ippisite/ippidb/tasks.py                                      | 3 ++-
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ippisite/.flake8 b/ippisite/.flake8
index 4f26fb01..41410fc3 100644
--- a/ippisite/.flake8
+++ b/ippisite/.flake8
@@ -1,3 +1,4 @@
 [flake8]
-ignore = E501, W503
+max-line-length = 120
+ignore = W503
 exclude = */migrations/*.py, manage.py, docs/source/conf.py
diff --git a/ippisite/ippidb/admin.py b/ippisite/ippidb/admin.py
index 7bfcba08..45385a30 100644
--- a/ippisite/ippidb/admin.py
+++ b/ippisite/ippidb/admin.py
@@ -137,7 +137,9 @@ class ContributionModelAdmin(ViewOnSiteModelAdmin):
         launch_validate_contributions.delay(ids)
         self.message_user(
             request,
-            f"validation started for contributions(s) {','.join(str(id) for id in queryset.values_list('id', flat=True))} (this might take a while).",
+            f"validation started for contributions(s) "
+            f"{','.join(str(id) for id in queryset.values_list('id', flat=True))}"
+            f" (this might take a while).",
         )
 
 
diff --git a/ippisite/ippidb/management/commands/compute_compound_properties.py b/ippisite/ippidb/management/commands/compute_compound_properties.py
index 9f7eb61e..22153cac 100644
--- a/ippisite/ippidb/management/commands/compute_compound_properties.py
+++ b/ippisite/ippidb/management/commands/compute_compound_properties.py
@@ -307,7 +307,8 @@ class Command(BaseCommand):
                 except ValueError as ve:
                     self.stderr.write(
                         self.style.ERROR(
-                            f"Error setting property {ippidb_prop} to {item[galaxy_prop]} in compound {compound.id} \ndetails:{ve}"
+                            f"Error setting property {ippidb_prop} to {item[galaxy_prop]}"
+                            f" in compound {compound.id} \ndetails:{ve}"
                         )
                     )
             properties_list.append(ippidb_dict)
diff --git a/ippisite/ippidb/tasks.py b/ippisite/ippidb/tasks.py
index 7b3267c8..becdf53d 100644
--- a/ippisite/ippidb/tasks.py
+++ b/ippisite/ippidb/tasks.py
@@ -114,7 +114,8 @@ def compute_compound_properties(compound_ids):
                 updated_properties[ippidb_prop] = ippidb_conv(item[galaxy_prop])
             except ValueError as ve:
                 print(
-                    f"Error setting property {ippidb_prop} to {item[galaxy_prop]} in compound {compound.id} \ndetails:{ve}"
+                    f"Error setting property {ippidb_prop} to {item[galaxy_prop]}"
+                    f" in compound {compound.id} \ndetails:{ve}"
                 )
         for key, value in updated_properties.items():
             setattr(compound, key, value)
-- 
GitLab