Skip to content
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
4 changes: 2 additions & 2 deletions src/python/review/inspectors/base_inspector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import abc
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.inspectors.inspector_type import InspectorType
from src.python.review.inspectors.issue import BaseIssue
Expand Down Expand Up @@ -30,5 +30,5 @@ def inspector_type(self) -> InspectorType:
raise NotImplementedError('inspector_type property not implemented yet')

@abc.abstractmethod
def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
raise NotImplementedError('inspect method not implemented yet')
4 changes: 2 additions & 2 deletions src/python/review/inspectors/checkstyle/checkstyle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.common.file_system import new_temp_dir
from src.python.review.common.subprocess_runner import run_in_subprocess
Expand Down Expand Up @@ -42,7 +42,7 @@ def _create_command(cls, path: Path, output_path: Path) -> List[str]:
'-f', 'xml', '-o', output_path, str(path),
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
with new_temp_dir() as temp_dir:
output_path = temp_dir / 'output.xml'
command = self._create_command(path, output_path)
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/detekt/detekt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.common.file_system import new_temp_dir
from src.python.review.common.subprocess_runner import run_in_subprocess
Expand Down Expand Up @@ -41,7 +41,7 @@ def _create_command(cls, path: Path, output_path: Path):
'--input', str(path),
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
with new_temp_dir() as temp_dir:
output_path = temp_dir / 'output.xml'
command = self._create_command(path, output_path)
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/eslint/eslint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.common.file_system import new_temp_dir
from src.python.review.common.subprocess_runner import run_in_subprocess
Expand Down Expand Up @@ -32,7 +32,7 @@ def _create_command(cls, path: Path, output_path: Path) -> List[str]:
path,
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
with new_temp_dir() as temp_dir:
output_path = temp_dir / 'output.xml'
command = self._create_command(path, output_path)
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/flake8/flake8.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import re
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.common.subprocess_runner import run_in_subprocess
from src.python.review.inspectors.base_inspector import BaseInspector
Expand Down Expand Up @@ -34,7 +34,7 @@ class Flake8Inspector(BaseInspector):
inspector_type = InspectorType.FLAKE8

@classmethod
def inspect(cls, path: Path, config: dict) -> List[BaseIssue]:
def inspect(cls, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
command = [
'flake8',
f'--format={FORMAT}',
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/intellij/intellij.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import re
from pathlib import Path
from typing import Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union
from xml.etree import ElementTree

from src.python.review.common.file_system import get_all_file_system_items, new_temp_dir
Expand Down Expand Up @@ -51,7 +51,7 @@ def create_command(output_dir_path) -> List[Union[str, Path]]:
INTELLIJ_INSPECTOR_SETTINGS, output_dir_path, '-v2',
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:

path_in_project_to_origin_path = self.copy_files_to_project(path)
try:
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/pmd/pmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import os
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.application_config import LanguageVersion
from src.python.review.common.file_system import new_temp_dir
Expand Down Expand Up @@ -42,7 +42,7 @@ def _create_command(cls, path: Path,
'-t', str(n_cpu),
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
with new_temp_dir() as temp_dir:
output_path = Path(temp_dir / 'out.csv')

Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/pyast/python_ast.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ast
from collections import Counter, defaultdict
from pathlib import Path
from typing import Dict, List
from typing import Any, Dict, List

from src.python.review.common import language
from src.python.review.common.file_system import get_all_file_system_items
Expand Down Expand Up @@ -109,7 +109,7 @@ class PythonAstInspector(BaseInspector):
inspector_type = InspectorType.PYTHON_AST

@classmethod
def inspect(cls, path: Path, config: dict) -> List[BaseIssue]:
def inspect(cls, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
if path.is_file():
path_to_files = [path]
else:
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/pylint/pylint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import re
from pathlib import Path
from typing import List, Optional
from typing import Any, Dict, List, Optional

from src.python.review.common.subprocess_runner import run_in_subprocess
from src.python.review.inspectors.base_inspector import BaseInspector
Expand All @@ -25,7 +25,7 @@ class PylintInspector(BaseInspector):
)

@classmethod
def inspect(cls, path: Path, config: dict) -> List[CodeIssue]:
def inspect(cls, path: Path, config: Dict[str, Any]) -> List[CodeIssue]:
command = [
'pylint',
'--load-plugins', 'pylint_django',
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/radon/radon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from pathlib import Path
from typing import List
from typing import Any, Dict, List

from src.python.review.common.subprocess_runner import run_in_subprocess
from src.python.review.inspectors.base_inspector import BaseInspector
Expand All @@ -17,7 +17,7 @@ class RadonInspector(BaseInspector):
inspector_type = InspectorType.RADON

@classmethod
def inspect(cls, path: Path, config: dict) -> List[BaseIssue]:
def inspect(cls, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
mi_command = [
'radon', 'mi', # compute the Maintainability Index score
'--max', 'F', # set the maximum MI rank to display
Expand Down
4 changes: 2 additions & 2 deletions src/python/review/inspectors/spotbugs/spotbugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
from collections import Counter
from pathlib import Path
from typing import Dict, List
from typing import Any, Dict, List

from src.python.review.common.file_system import get_all_file_system_items
from src.python.review.common.java_compiler import javac, javac_project
Expand Down Expand Up @@ -33,7 +33,7 @@ def _create_command(cls, path: Path) -> List[str]:
str(path),
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
if path.is_file():
is_successful = javac(path)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/python/review/inspectors/springlint/springlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _create_command(cls, path: Path, output_path: Path) -> List[str]:
'--project', str(path),
]

def inspect(self, path: Path, config: dict) -> List[BaseIssue]:
def inspect(self, path: Path, config: Dict[str, Any]) -> List[BaseIssue]:
with new_temp_dir() as temp_dir:
if path.is_file():
return self._inspect_file(path, temp_dir)
Expand Down