Scrapy, a fast high-level web crawling & scraping framework for Python.
Fix W391 Blank line at end of file (#4137)
Marc Hernándezc377c14e3263
diff --git a/pytest.ini b/pytest.iniindex 0e4ee9ed1..db5bee228 100644--- a/pytest.ini+++ b/pytest.ini@@ -10,7 +10,7 @@ flake8-ignore =extras/qpsclient.py E501 E261 E501# scrapy/commandsscrapy/commands/__init__.py E128 E501- scrapy/commands/check.py F401 E501 W391+ scrapy/commands/check.py F401 E501scrapy/commands/crawl.py E501scrapy/commands/edit.py E501scrapy/commands/fetch.py E401 E302 E501 E128 E502 E731@@ -20,8 +20,8 @@ flake8-ignore =scrapy/commands/runspider.py E501scrapy/commands/settings.py E302 E128scrapy/commands/shell.py E128 E501 E502- scrapy/commands/startproject.py E502 E127 E501 E128 W391- scrapy/commands/version.py E501 E128 W391+ scrapy/commands/startproject.py E502 E127 E501 E128+ scrapy/commands/version.py E501 E128scrapy/commands/view.py F401 E302# scrapy/contractsscrapy/contracts/__init__.py E501 W504@@ -29,15 +29,15 @@ flake8-ignore =# scrapy/corescrapy/core/engine.py E261 E501 E128 E127 E306 E502scrapy/core/scheduler.py E501- scrapy/core/scraper.py E501 E306 E261 E128 W391 W504+ scrapy/core/scraper.py E501 E306 E261 E128 W504scrapy/core/spidermw.py E501 E731 E502 E231 E126 E226scrapy/core/downloader/__init__.py F401 E501scrapy/core/downloader/contextfactory.py E501 E128 E126scrapy/core/downloader/middleware.py E501 E502scrapy/core/downloader/tls.py E501 E305 E241- scrapy/core/downloader/webclient.py E731 E501 E261 E502 E128 W391 E126 E226+ scrapy/core/downloader/webclient.py E731 E501 E261 E502 E128 E126 E226scrapy/core/downloader/handlers/__init__.py E501- scrapy/core/downloader/handlers/ftp.py E501 E305 E128 E127 W391+ scrapy/core/downloader/handlers/ftp.py E501 E305 E128 E127scrapy/core/downloader/handlers/http.py F401scrapy/core/downloader/handlers/http10.py E501scrapy/core/downloader/handlers/http11.py E501@@ -66,7 +66,6 @@ flake8-ignore =scrapy/http/__init__.py F401scrapy/http/common.py E501scrapy/http/cookies.py E501- scrapy/http/headers.py W391scrapy/http/request/__init__.py E501scrapy/http/request/form.py E501 E123scrapy/http/request/json_request.py E501@@ -101,8 +100,7 @@ flake8-ignore =# scrapy/spidersscrapy/spiders/__init__.py F401 E501 E402scrapy/spiders/crawl.py E501- scrapy/spiders/feed.py E501 E261 W391- scrapy/spiders/init.py W391+ scrapy/spiders/feed.py E501 E261scrapy/spiders/sitemap.py E501# scrapy/utilsscrapy/utils/benchserver.py E501@@ -118,7 +116,7 @@ flake8-ignore =scrapy/utils/engine.py F401 E261 E302scrapy/utils/ftp.py E302scrapy/utils/gz.py E305 E501 E302 W504- scrapy/utils/http.py F403 F401 W391 E226+ scrapy/utils/http.py F403 F401 E226scrapy/utils/httpobj.py E302 E501scrapy/utils/iterators.py E501 E701scrapy/utils/job.py E302@@ -148,9 +146,9 @@ flake8-ignore =scrapy/exceptions.py E302 E501scrapy/exporters.py E501 E261 E226scrapy/extension.py E302- scrapy/interfaces.py E302 E501 W391+ scrapy/interfaces.py E302 E501scrapy/item.py E501 E128- scrapy/link.py E501 W391+ scrapy/link.py E501scrapy/logformatter.py E501 W293scrapy/mail.py E402 E128 E501 E502scrapy/middleware.py E502 E128 E501@@ -162,7 +160,7 @@ flake8-ignore =scrapy/signalmanager.py E501scrapy/spiderloader.py E225 F841 E501 E126scrapy/squeues.py E128- scrapy/statscollectors.py E501 W391+ scrapy/statscollectors.py E501# teststests/__init__.py F401 E402 E501tests/mockserver.py E401 E501 E126 E123 F401@@ -218,20 +216,18 @@ flake8-ignore =tests/test_selector.py F401 E501 E127tests/test_spider.py E501 F401tests/test_spidermiddleware.py E501 E226- tests/test_spidermiddleware_depth.py W391tests/test_spidermiddleware_httperror.py E128 E501 E127 E121tests/test_spidermiddleware_offsite.py E302 E501 E128 E111 W293tests/test_spidermiddleware_output_chain.py F401 E501 E302 W293 E226- tests/test_spidermiddleware_referer.py F401 E501 E302 F841 E125 E201 E261 E124 E501 W391 E241 E121- tests/test_spidermiddleware_urllength.py W391+ tests/test_spidermiddleware_referer.py F401 E501 E302 F841 E125 E201 E261 E124 E501 E241 E121tests/test_squeues.py E501 E302 E701 E741tests/test_utils_conf.py E501 E231 E303 E128tests/test_utils_console.py E302 E231tests/test_utils_curl.py E501- tests/test_utils_datatypes.py E402 E501 E305 W391+ tests/test_utils_datatypes.py E402 E501 E305tests/test_utils_defer.py E306 E261 E501 E302 F841 E226tests/test_utils_deprecate.py F841 E306 E501- tests/test_utils_http.py E302 E501 E502 E128 W391 W504+ tests/test_utils_http.py E302 E501 E502 E128 W504tests/test_utils_httpobj.py E302tests/test_utils_iterators.py E501 E128 E129 E302 E303 E241tests/test_utils_log.py E741 E226@@ -241,15 +237,14 @@ flake8-ignore =tests/test_utils_response.py E501tests/test_utils_signal.py E741 F841 E302 E731 E226tests/test_utils_sitemap.py E302 E128 E501 E124- tests/test_utils_spider.py E261 E302 E305 W391+ tests/test_utils_spider.py E261 E302 E305tests/test_utils_template.py E305tests/test_utils_url.py F401 E501 E127 E302 E305 E211 E125 E501 E226 E241 E126 E123tests/test_webclient.py E501 E128 E122 E303 E402 E306 E226 E241 E123 E126tests/mocks/dummydbm.py E302tests/test_cmdline/__init__.py E502 E501- tests/test_cmdline/extensions.py E302 W391+ tests/test_cmdline/extensions.py E302tests/test_settings/__init__.py F401 E501 E128- tests/test_settings/default_settings.py W391tests/test_spiderloader/__init__.py E128 E501 E302tests/test_spiderloader/test_spiders/spider0.py E302tests/test_spiderloader/test_spiders/spider1.py E302diff --git a/scrapy/commands/check.py b/scrapy/commands/check.pyindex ab73e85e7..3e6c11b7d 100644--- a/scrapy/commands/check.py+++ b/scrapy/commands/check.py@@ -96,4 +96,3 @@ class Command(ScrapyCommand):result.printErrors()result.printSummary(start, stop)self.exitcode = int(not result.wasSuccessful())-diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.pyindex 67337c26e..3b9f6eabb 100644--- a/scrapy/commands/startproject.py+++ b/scrapy/commands/startproject.py@@ -119,4 +119,3 @@ class Command(ScrapyCommand):_templates_base_dir = self.settings['TEMPLATES_DIR'] or \join(scrapy.__path__[0], 'templates')return join(_templates_base_dir, 'project')-diff --git a/scrapy/commands/version.py b/scrapy/commands/version.pyindex 577365c3b..8651948f7 100644--- a/scrapy/commands/version.py+++ b/scrapy/commands/version.py@@ -30,4 +30,3 @@ class Command(ScrapyCommand):print(patt % (name, version))else:print("Scrapy %s" % scrapy.__version__)-diff --git a/scrapy/core/downloader/handlers/ftp.py b/scrapy/core/downloader/handlers/ftp.pyindex 806a537d4..39ed67a1a 100644--- a/scrapy/core/downloader/handlers/ftp.py+++ b/scrapy/core/downloader/handlers/ftp.py@@ -112,4 +112,3 @@ class FTPDownloadHandler(object):httpcode = self.CODE_MAPPING.get(ftpcode, self.CODE_MAPPING["default"])return Response(url=request.url, status=httpcode, body=to_bytes(message))raise result.type(result.value)-diff --git a/scrapy/core/downloader/webclient.py b/scrapy/core/downloader/webclient.pyindex 3a5890ed0..3fe13414a 100644--- a/scrapy/core/downloader/webclient.py+++ b/scrapy/core/downloader/webclient.py@@ -157,4 +157,3 @@ class ScrapyHTTPClientFactory(HTTPClientFactory):def gotHeaders(self, headers):self.headers_time = time()self.response_headers = headers-diff --git a/scrapy/core/scraper.py b/scrapy/core/scraper.pyindex 1f389cf2e..40de6b87a 100644--- a/scrapy/core/scraper.py+++ b/scrapy/core/scraper.py@@ -244,4 +244,3 @@ class Scraper(object):return self.signals.send_catch_log_deferred(signal=signals.item_scraped, item=output, response=response,spider=spider)-diff --git a/scrapy/http/headers.py b/scrapy/http/headers.pyindex 62507eb19..f3b46b994 100644--- a/scrapy/http/headers.py+++ b/scrapy/http/headers.py@@ -91,5 +91,3 @@ class Headers(CaselessDict):def __copy__(self):return self.__class__(self)copy = __copy__--diff --git a/scrapy/interfaces.py b/scrapy/interfaces.pyindex 89ad2b14f..d48babc3c 100644--- a/scrapy/interfaces.py+++ b/scrapy/interfaces.py@@ -15,4 +15,3 @@ class ISpiderLoader(Interface):def find_by_request(request):"""Return the list of spiders names that can handle the given request"""-diff --git a/scrapy/link.py b/scrapy/link.pyindex 2c8301680..f0638ced2 100644--- a/scrapy/link.py+++ b/scrapy/link.py@@ -39,4 +39,3 @@ class Link(object):def __repr__(self):return 'Link(url=%r, text=%r, fragment=%r, nofollow=%r)' % \(self.url, self.text, self.fragment, self.nofollow)-diff --git a/scrapy/spiders/feed.py b/scrapy/spiders/feed.pyindex 06e212e1c..197812a26 100644--- a/scrapy/spiders/feed.py+++ b/scrapy/spiders/feed.py@@ -133,4 +133,3 @@ class CSVFeedSpider(Spider):raise NotConfigured('You must define parse_row method in order to scrape this CSV feed')response = self.adapt_response(response)return self.parse_rows(response)-diff --git a/scrapy/spiders/init.py b/scrapy/spiders/init.pyindex 2efb1a869..fd41133ea 100644--- a/scrapy/spiders/init.py+++ b/scrapy/spiders/init.py@@ -29,4 +29,3 @@ class InitSpider(Spider):spider"""return self.initialized()-diff --git a/scrapy/statscollectors.py b/scrapy/statscollectors.pyindex 6da9ddcd2..f0bfaed34 100644--- a/scrapy/statscollectors.py+++ b/scrapy/statscollectors.py@@ -80,5 +80,3 @@ class DummyStatsCollector(StatsCollector):def min_value(self, key, value, spider=None):pass--diff --git a/scrapy/utils/http.py b/scrapy/utils/http.pyindex b6e05c862..ad49ef3e9 100644--- a/scrapy/utils/http.py+++ b/scrapy/utils/http.py@@ -34,4 +34,3 @@ def decode_chunked_transfer(chunked_body):body += t[:size]t = t[size+2:]return body-diff --git a/tests/test_cmdline/extensions.py b/tests/test_cmdline/extensions.pyindex 72867eb56..28456b55d 100644--- a/tests/test_cmdline/extensions.py+++ b/tests/test_cmdline/extensions.py@@ -12,4 +12,3 @@ class TestExtension(object):class DummyExtension(object):pass-diff --git a/tests/test_settings/default_settings.py b/tests/test_settings/default_settings.pyindex c24b5a9b9..26a555275 100644--- a/tests/test_settings/default_settings.py+++ b/tests/test_settings/default_settings.py@@ -2,4 +2,3 @@TEST_DEFAULT = 'defvalue'TEST_DICT = {'key': 'val'}-diff --git a/tests/test_spidermiddleware_depth.py b/tests/test_spidermiddleware_depth.pyindex 3685d5a6f..71cca2472 100644--- a/tests/test_spidermiddleware_depth.py+++ b/tests/test_spidermiddleware_depth.py@@ -40,4 +40,3 @@ class TestDepthMiddleware(TestCase):def tearDown(self):self.stats.close_spider(self.spider, '')-diff --git a/tests/test_spidermiddleware_urllength.py b/tests/test_spidermiddleware_urllength.pyindex a0aae0fdd..5ef2b23fd 100644--- a/tests/test_spidermiddleware_urllength.py+++ b/tests/test_spidermiddleware_urllength.py@@ -18,4 +18,3 @@ class TestUrlLengthMiddleware(TestCase):spider = Spider('foo')out = list(mw.process_spider_output(res, reqs, spider))self.assertEqual(out, [short_url_req])-diff --git a/tests/test_utils_datatypes.py b/tests/test_utils_datatypes.pyindex 535095b8d..9455172fa 100644--- a/tests/test_utils_datatypes.py+++ b/tests/test_utils_datatypes.py@@ -244,4 +244,3 @@ class SequenceExcludeTest(unittest.TestCase):if __name__ == "__main__":unittest.main()-diff --git a/tests/test_utils_http.py b/tests/test_utils_http.pyindex 583105673..2524153ea 100644--- a/tests/test_utils_http.py+++ b/tests/test_utils_http.py@@ -16,5 +16,3 @@ class ChunkedTest(unittest.TestCase):"This is the data in the first chunk\r\n" +"and this is the second one\r\n" +"consequence")--diff --git a/tests/test_utils_spider.py b/tests/test_utils_spider.pyindex 045e72117..d9de1ce77 100644--- a/tests/test_utils_spider.py+++ b/tests/test_utils_spider.py@@ -34,4 +34,3 @@ class UtilsSpidersTestCase(unittest.TestCase):if __name__ == "__main__":unittest.main()-