From 6d6ab9a53193b20ba3f2e6d8691fc50f287616d0 Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Sun, 5 Jun 2022 14:38:03 -0700 Subject: [PATCH] Add .pylintrc with fixes for new pylint version --- .pylintrc | 6 ++++++ bookwyrm/tests/connectors/test_openlibrary_connector.py | 2 +- bookwyrm/tests/models/test_import_model.py | 2 +- bookwyrm/tests/views/test_status.py | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 000000000..7f92d0168 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,6 @@ +[MAIN] +ignore=migrations +load-plugins=pylint.extensions.no_self_use + +[MESSAGES CONTROL] +disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801,C3001 diff --git a/bookwyrm/tests/connectors/test_openlibrary_connector.py b/bookwyrm/tests/connectors/test_openlibrary_connector.py index c05eb1a94..8f81b2073 100644 --- a/bookwyrm/tests/connectors/test_openlibrary_connector.py +++ b/bookwyrm/tests/connectors/test_openlibrary_connector.py @@ -229,7 +229,7 @@ class Openlibrary(TestCase): status=200, ) with patch( - "bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data" + "bookwyrm.connectors.openlibrary.Connector.get_authors_from_data" ) as mock: mock.return_value = [] result = self.connector.create_edition_from_data(work, self.edition_data) diff --git a/bookwyrm/tests/models/test_import_model.py b/bookwyrm/tests/models/test_import_model.py index 7cecfe416..d1ff209f4 100644 --- a/bookwyrm/tests/models/test_import_model.py +++ b/bookwyrm/tests/models/test_import_model.py @@ -195,7 +195,7 @@ class ImportJob(TestCase): ) as search: search.return_value = result with patch( - "bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data" + "bookwyrm.connectors.openlibrary.Connector.get_authors_from_data" ): book = item.get_book_from_identifier() diff --git a/bookwyrm/tests/views/test_status.py b/bookwyrm/tests/views/test_status.py index 355071573..0026c52b5 100644 --- a/bookwyrm/tests/views/test_status.py +++ b/bookwyrm/tests/views/test_status.py @@ -281,7 +281,7 @@ http://www.fish.com/""" result = views.status.to_markdown(text) self.assertEqual( result, - '

hi and fish.com ' "is rad

", + '

hi and fish.com is rad

', ) def test_to_markdown_detect_url(self, *_): @@ -297,7 +297,7 @@ http://www.fish.com/""" """this is mostly handled in other places, but nonetheless""" text = "[hi](http://fish.com) is rad" result = views.status.to_markdown(text) - self.assertEqual(result, '

hi ' "is rad

") + self.assertEqual(result, '

hi is rad

') def test_delete_status(self, mock, *_): """marks a status as deleted"""