Don't blanket ignore flake8 E402 error (#6734)

Instead this starts ignoring it in specific places only, because most
files don't actually need it ignored.
pull/6736/head
Jelte Fennema 2023-02-27 16:17:15 +01:00 committed by GitHub
parent 7b8e614039
commit c018e29bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 24 deletions

View File

@ -1,7 +1,6 @@
[flake8] [flake8]
# E203 is ignored for black # E203 is ignored for black
# E402 is ignored because of te way we do relative imports extend-ignore = E203
extend-ignore = E203, E402
# black will truncate to 88 characters usually, but long string literals it # black will truncate to 88 characters usually, but long string literals it
# might keep. That's fine in most cases unless it gets really excessive. # might keep. That's fine in most cases unless it gets really excessive.
max-line-length = 150 max-line-length = 150

View File

@ -12,23 +12,23 @@ Options:
--seed=<seed> random number seed --seed=<seed> random number seed
--base whether to use the base sql schedule or not --base whether to use the base sql schedule or not
""" """
import concurrent.futures
import multiprocessing
import os import os
import random
import shutil import shutil
import sys import sys
import time
from docopt import docopt
# https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912 # https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# ignore E402 because these imports require addition to path
import common # noqa: E402
import concurrent.futures import config as cfg # noqa: E402
import multiprocessing
import random
import time
import common
from docopt import docopt
import config as cfg
testResults = {} testResults = {}
parallel_thread_amount = 1 parallel_thread_amount = 1

View File

@ -19,15 +19,17 @@ import re
import subprocess import subprocess
import sys import sys
from docopt import docopt
# https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912 # https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import common # ignore E402 because these imports require addition to path
import utils import common # noqa: E402
from docopt import docopt import utils # noqa: E402
from utils import USER from utils import USER # noqa: E402
from config import ( from config import ( # noqa: E402
AFTER_CITUS_UPGRADE_COORD_SCHEDULE, AFTER_CITUS_UPGRADE_COORD_SCHEDULE,
BEFORE_CITUS_UPGRADE_COORD_SCHEDULE, BEFORE_CITUS_UPGRADE_COORD_SCHEDULE,
CITUS_VERSION_SQL, CITUS_VERSION_SQL,

View File

@ -10,21 +10,22 @@ Options:
--pgxsdir=<pgxsdir> Path to the PGXS directory(ex: ~/.pgenv/src/postgresql-11.3) --pgxsdir=<pgxsdir> Path to the PGXS directory(ex: ~/.pgenv/src/postgresql-11.3)
""" """
import atexit
import os import os
import subprocess
import sys import sys
from docopt import docopt
# https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912 # https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time/14132912#14132912
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import atexit # ignore E402 because these imports require addition to path
import subprocess import common # noqa: E402
import utils # noqa: E402
from utils import USER # noqa: E402
import common from config import ( # noqa: E402
import utils
from docopt import docopt
from utils import USER
from config import (
AFTER_PG_UPGRADE_SCHEDULE, AFTER_PG_UPGRADE_SCHEDULE,
BEFORE_PG_UPGRADE_SCHEDULE, BEFORE_PG_UPGRADE_SCHEDULE,
PGUpgradeConfig, PGUpgradeConfig,