Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flake8 code quality #274 #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 36 additions & 34 deletions tests/_data/test.py
@@ -1,65 +1,67 @@
"""unused import"""
# pylint: disable=undefined-all-variable, import-error, no-absolute-import, too-few-public-methods, missing-docstring
# pylint: disable=undefined-all-variable, import-error, no-absolute-import
# pylint: disable=too-few-public-methods, missing-docstring
from __future__ import print_function # noqa:F401
import xml.etree # [unused-import]
import xml.sax # [unused-import]
import os.path as test # [unused-import]
from sys import argv as test2 # [unused-import]
from sys import flags # [unused-import]
import xml.sax # noqa:F401 # [unused-import]
import os.path as test # noqa:F401 # [unused-import]
from sys import argv as test2 # noqa:F401 # [unused-import]
from sys import flags # noqa:F401 # [unused-import]
# +1:[unused-import,unused-import]
from collections import deque, OrderedDict, Counter
from collections import deque, OrderedDict, Counter # noqa:F401
# All imports above should be ignored
import requests # [unused-import]
import requests # noqa:F401 # [unused-import]

# setuptools
import zipimport # command/easy_install.py

# twisted
from importlib import invalidate_caches # python/test/test_deprecate.py
from importlib import invalidate_caches # noqa:F401, E501 # python/test/test_deprecate.py

# astroid
import zipimport # manager.py
import zipimport # noqa:F401, F811 # manager.py
# IPython
from importlib.machinery import all_suffixes # core/completerlib.py
import importlib # html/notebookapp.py
from importlib.machinery import all_suffixes # noqa:F401, E501 # core/completerlib.py
import importlib # noqa:F401 # html/notebookapp.py

from IPython.utils.importstring import import_item # Many files
from IPython.utils.importstring import import_item # noqa:F401 # Many files

# pyflakes
# test/test_doctests.py
from pyflakes.test.test_imports import Test as TestImports
from pyflakes.test.test_imports import Test as TestImports # noqa:F401

# Nose
from nose.importer import Importer, add_path, remove_path # loader.py
from nose.importer import Importer, add_path, remove_path # noqa:F401, E501 # loader.py

# see issue #88
import analytics
import flask_seasurf
import analytics # noqa:F401
import flask_seasurf # noqa:F401

import atexit
from __future__ import print_function
from docopt import docopt
import curses, logging, sqlite3
import logging
import os
import sqlite3
import time
import sys
import signal
import bs4
import nonexistendmodule
import boto as b, peewee as p
import atexit # noqa:F401
from docopt import docopt # noqa:F401
import curses, logging, sqlite3 # noqa:F401, E401
import logging # noqa:F401, F811
import os # noqa:F401
import sqlite3 # noqa:F401, F811
import time # noqa:F401
import sys # noqa:F401
import signal # noqa:F401
import bs4 # noqa:F401
import nonexistendmodule # noqa:F401
import boto as b, peewee as p # noqa:F401, E401
# import django
import flask.ext.somext # # #
from sqlalchemy import model
import flask.ext.somext # noqa:F401 # # #
from sqlalchemy import model # noqa:F401
try:
import ujson as json
except ImportError:
import json
import json # noqa:F401

import models
import models # noqa:F401


def main():
pass

import after_method_is_valid_even_if_not_pep8

import after_method_is_valid_even_if_not_pep8 # noqa:F401, E402
70 changes: 36 additions & 34 deletions tests/_data_clean/test.py
@@ -1,65 +1,67 @@
"""unused import"""
# pylint: disable=undefined-all-variable, import-error, no-absolute-import, too-few-public-methods, missing-docstring
# pylint: disable=undefined-all-variable, import-error, no-absolute-import
# pylint: disable=too-few-public-methods, missing-docstring
from __future__ import print_function # noqa:F401
import xml.etree # [unused-import]
import xml.sax # [unused-import]
import os.path as test # [unused-import]
from sys import argv as test2 # [unused-import]
from sys import flags # [unused-import]
import xml.sax # noqa:F401 # [unused-import]
import os.path as test # noqa:F401 # [unused-import]
from sys import argv as test2 # noqa:F401 # [unused-import]
from sys import flags # noqa:F401 # [unused-import]
# +1:[unused-import,unused-import]
from collections import deque, OrderedDict, Counter
from collections import deque, OrderedDict, Counter # noqa:F401
# All imports above should be ignored
import requests # [unused-import]
import requests # noqa:F401 # [unused-import]

# setuptools
import zipimport # command/easy_install.py

# twisted
from importlib import invalidate_caches # python/test/test_deprecate.py
from importlib import invalidate_caches # noqa:F401, E501 # python/test/test_deprecate.py

# astroid
import zipimport # manager.py
import zipimport # noqa:F401, F811 # manager.py
# IPython
from importlib.machinery import all_suffixes # core/completerlib.py
import importlib # html/notebookapp.py
from importlib.machinery import all_suffixes # noqa:F401, E501 # core/completerlib.py
import importlib # noqa:F401 # html/notebookapp.py

from IPython.utils.importstring import import_item # Many files
from IPython.utils.importstring import import_item # noqa:F401 # Many files

# pyflakes
# test/test_doctests.py
from pyflakes.test.test_imports import Test as TestImports
from pyflakes.test.test_imports import Test as TestImports # noqa:F401

# Nose
from nose.importer import Importer, add_path, remove_path # loader.py
from nose.importer import Importer, add_path, remove_path # noqa:F401, E501 # loader.py

# see issue #88
import analytics
import flask_seasurf
import analytics # noqa:F401
import flask_seasurf # noqa:F401

import atexit
from __future__ import print_function
from docopt import docopt
import curses, logging, sqlite3
import logging
import os
import sqlite3
import time
import sys
import signal
import bs4
import nonexistendmodule
import boto as b, peewee as p
import atexit # noqa:F401
from docopt import docopt # noqa:F401
import curses, logging, sqlite3 # noqa:F401, E401
import logging # noqa:F401, F811
import os # noqa:F401
import sqlite3 # noqa:F401, F811
import time # noqa:F401
import sys # noqa:F401
import signal # noqa:F401
import bs4 # noqa:F401
import nonexistendmodule # noqa:F401
import boto as b, peewee as p # noqa:F401, E401
# import django
import flask.ext.somext # # #
# from sqlalchemy import model
import flask.ext.somext # noqa:F401 # # #
from sqlalchemy import model # noqa:F401
try:
import ujson as json
except ImportError:
import json
import json # noqa:F401

import models
import models # noqa:F401


def main():
pass

import after_method_is_valid_even_if_not_pep8

import after_method_is_valid_even_if_not_pep8 # noqa:F401, E402
4 changes: 2 additions & 2 deletions tests/_data_duplicated_deps/db.py
@@ -1,5 +1,5 @@
import pymongo
from bson.objectid import ObjectId
import pymongo # noqa:F401
from bson.objectid import ObjectId # noqa:F401

# 'bson' package is mapped to 'pymongo'.
# But running pipreqs should not result in two duplicated
Expand Down
2 changes: 1 addition & 1 deletion tests/_data_ignore/.ignore_second/ignored.py
@@ -1,2 +1,2 @@
# Everything in here should be ignored
from pattern.web import Twitter, plaintext
from pattern.web import Twitter, plaintext # noqa:F401
2 changes: 1 addition & 1 deletion tests/_data_ignore/.ignored_dir/ignored.py
@@ -1,2 +1,2 @@
# Everything in here should be ignored
import click
import click # noqa:F401
68 changes: 35 additions & 33 deletions tests/_data_ignore/test.py
@@ -1,61 +1,63 @@
"""unused import"""
# pylint: disable=undefined-all-variable, import-error, no-absolute-import, too-few-public-methods, missing-docstring
# pylint: disable=undefined-all-variable, import-error, no-absolute-import
# pylint: disable=too-few-public-methods, missing-docstring
from __future__ import print_function # noqa:F401
import xml.etree # [unused-import]
import xml.sax # [unused-import]
import os.path as test # [unused-import]
from sys import argv as test2 # [unused-import]
from sys import flags # [unused-import]
import xml.sax # noqa:F401 # [unused-import]
import os.path as test # noqa:F401 # [unused-import]
from sys import argv as test2 # noqa:F401 # [unused-import]
from sys import flags # noqa:F401 # [unused-import]
# +1:[unused-import,unused-import]
from collections import deque, OrderedDict, Counter
from collections import deque, OrderedDict, Counter # noqa:F401
# All imports above should be ignored
import requests # [unused-import]
import requests # noqa:F401 # [unused-import]

# setuptools
import zipimport # command/easy_install.py

# twisted
from importlib import invalidate_caches # python/test/test_deprecate.py
from importlib import invalidate_caches # noqa:F401, E501 # python/test/test_deprecate.py

# astroid
import zipimport # manager.py
import zipimport # noqa:F401, F811 # manager.py
# IPython
from importlib.machinery import all_suffixes # core/completerlib.py
import importlib # html/notebookapp.py
from importlib.machinery import all_suffixes # noqa:F401, E501 # core/completerlib.py
import importlib # noqa:F401 # html/notebookapp.py

from IPython.utils.importstring import import_item # Many files
from IPython.utils.importstring import import_item # noqa:F401 # Many files

# pyflakes
# test/test_doctests.py
from pyflakes.test.test_imports import Test as TestImports
from pyflakes.test.test_imports import Test as TestImports # noqa:F401

# Nose
from nose.importer import Importer, add_path, remove_path # loader.py

import atexit
from __future__ import print_function
from docopt import docopt
import curses, logging, sqlite3
import logging
import os
import sqlite3
import time
import sys
import signal
import bs4
import nonexistendmodule
import boto as b, peewee as p
from nose.importer import Importer, add_path, remove_path # noqa:F401, E501 # loader.py

import atexit # noqa:F401
from docopt import docopt # noqa:F401
import curses, logging, sqlite3 # noqa:F401, E401
import logging # noqa:F401, F811
import os # noqa:F401
import sqlite3 # noqa:F401, F811
import time # noqa:F401
import sys # noqa:F401
import signal # noqa:F401
import bs4 # noqa:F401
import nonexistendmodule # noqa:F401
import boto as b, peewee as p # noqa:F401, E401
# import django
import flask.ext.somext # # #
from sqlalchemy import model
import flask.ext.somext # noqa:F401 # # #
from sqlalchemy import model # noqa:F401
try:
import ujson as json
except ImportError:
import json
import json # noqa:F401

import models
import models # noqa:F401


def main():
pass

import after_method_is_valid_even_if_not_pep8

import after_method_is_valid_even_if_not_pep8 # noqa:F401, E402
2 changes: 1 addition & 1 deletion tests/_invalid_data/invalid.py
@@ -1 +1 @@
import boto as b, import peewee as p,
import boto as b, import peewee as p, # noqa:E401, E999