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

Add black to the CI #620

Merged
merged 2 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHON_PYLINT_CONFIG_FILE: pyproject.toml
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
VALIDATE_JSON: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_DOCKERFILE: false
VALIDATE_DOCKERFILE_HADOLINT: false
Expand Down
4 changes: 3 additions & 1 deletion plugin_example/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
packages=find_packages(),
python_requires=">=3.6",
install_requires=["slither-analyzer==0.1"],
entry_points={"slither_analyzer.plugin": "slither my-plugin=slither_my_plugin:make_plugin",},
entry_points={
"slither_analyzer.plugin": "slither my-plugin=slither_my_plugin:make_plugin",
},
)
10 changes: 8 additions & 2 deletions slither/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ def parse_args(detector_classes, printer_classes):
)

group_misc.add_argument(
"--markdown-root", help="URL for markdown generation", action="store", default="",
"--markdown-root",
help="URL for markdown generation",
action="store",
default="",
)

group_misc.add_argument(
Expand Down Expand Up @@ -437,7 +440,10 @@ def parse_args(detector_classes, printer_classes):
)

group_misc.add_argument(
"--solc-ast", help="Provide the contract as a json AST", action="store_true", default=False,
"--solc-ast",
help="Provide the contract as a json AST",
action="store_true",
default=False,
)

group_misc.add_argument(
Expand Down
19 changes: 16 additions & 3 deletions slither/analyses/data_dependency/data_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def is_tainted_ssa(variable, context, only_unprotected=False, ignore_generic_tai


def get_dependencies(
variable: Variable, context: Union[Contract, Function], only_unprotected: bool = False,
variable: Variable,
context: Union[Contract, Function],
only_unprotected: bool = False,
) -> Set[Variable]:
"""
Return the variables for which `variable` depends on.
Expand Down Expand Up @@ -170,7 +172,9 @@ def get_all_dependencies(


def get_dependencies_ssa(
variable: Variable, context: Union[Contract, Function], only_unprotected: bool = False,
variable: Variable,
context: Union[Contract, Function],
only_unprotected: bool = False,
) -> Set[Variable]:
"""
Return the variables for which `variable` depends on (SSA version).
Expand Down Expand Up @@ -376,7 +380,16 @@ def convert_variable_to_non_ssa(v):
return v.non_ssa_version
assert isinstance(
v,
(Constant, SolidityVariable, Contract, Enum, SolidityFunction, Structure, Function, Type,),
(
Constant,
SolidityVariable,
Contract,
Enum,
SolidityFunction,
Structure,
Function,
Type,
),
)
return v

Expand Down
5 changes: 4 additions & 1 deletion slither/analyses/write/are_variables_written.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def __init__(self):

# pylint: disable=too-many-branches
def _visit(
node: Node, state: State, variables_written: Set[Variable], variables_to_write: List[Variable],
node: Node,
state: State,
variables_written: Set[Variable],
variables_to_write: List[Variable],
):
"""
Explore all the nodes to look for values not written when the node's function return
Expand Down
Loading