mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
pylint_all: Make better use of the PROJECT_ROOT variable
This commit is contained in:
parent
9b3e714a6c
commit
0746f2adf9
@ -9,8 +9,8 @@ from os import path, walk, system
|
|||||||
from sys import exit as exitwith
|
from sys import exit as exitwith
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
PROJECT_ROOT = path.dirname(path.realpath(__file__))
|
PROJECT_ROOT = path.dirname(path.dirname(path.realpath(__file__)))
|
||||||
PYLINT_RCFILE = "{}/pylintrc".format(PROJECT_ROOT)
|
PYLINT_RCFILE = f"{PROJECT_ROOT}/scripts/pylintrc"
|
||||||
|
|
||||||
SGR_INFO = "\033[1;32m"
|
SGR_INFO = "\033[1;32m"
|
||||||
SGR_CLEAR = "\033[0m"
|
SGR_CLEAR = "\033[0m"
|
||||||
@ -61,10 +61,14 @@ def parse_command_line():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = parse_command_line()
|
options = parse_command_line()
|
||||||
failed_count, total_count = pylint_all_filenames(options.dev_mode, [
|
|
||||||
path.abspath(path.dirname(__file__) + "/../docs"),
|
rootdirs = [
|
||||||
path.abspath(path.dirname(__file__) + "/../scripts"),
|
f"{PROJECT_ROOT}/docs",
|
||||||
path.abspath(path.dirname(__file__) + "/../test")])
|
f"{PROJECT_ROOT}/scripts",
|
||||||
|
f"{PROJECT_ROOT}/test",
|
||||||
|
]
|
||||||
|
(failed_count, total_count) = pylint_all_filenames(options.dev_mode, rootdirs)
|
||||||
|
|
||||||
if failed_count != 0:
|
if failed_count != 0:
|
||||||
exitwith("pylint failed on {}/{} files.".format(failed_count, total_count))
|
exitwith("pylint failed on {}/{} files.".format(failed_count, total_count))
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user