12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-11-25T21:33:12.100673 #1] INFO -- : Skipping file ./src/nitpick/fields.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 18
def is_valid_json(json_string: str) -> bool:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.108331 #1] INFO -- : Skipping file ./src/nitpick/style.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 77
def builtin_resources_root() -> Path:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.113090 #1] INFO -- : Skipping file ./src/nitpick/__main__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 13
def main() -> None: # pragma: no cover
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.124397 #1] INFO -- : Skipping file ./src/nitpick/schemas.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 14
def flatten_marshmallow_errors(errors: dict) -> str:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.127584 #1] INFO -- : Skipping file ./src/nitpick/plugins/toml.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 33
identify_tags: ClassVar = {"toml"}
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.135727 #1] INFO -- : Skipping file ./src/nitpick/plugins/yaml.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 53
identify_tags: ClassVar = {"yaml"}
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.139911 #1] INFO -- : Skipping file ./src/nitpick/plugins/text.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 57
identify_tags: ClassVar = {"text"}
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.147416 #1] INFO -- : Skipping file ./src/nitpick/plugins/base.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 26
class NitpickPlugin(metaclass=abc.ABCMeta): # pylint: disable=too-many-instance-attributes
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.151399 #1] INFO -- : Skipping file ./src/nitpick/plugins/json.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 42
identify_tags: ClassVar = {"json"}
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.159822 #1] INFO -- : Skipping file ./src/nitpick/plugins/__init__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 28
def plugin_class() -> type[NitpickPlugin]: # type: ignore[empty-body]
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.162452 #1] INFO -- : Skipping file ./src/nitpick/plugins/ini.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 31
INVALID_COMMA_SEPARATED_VALUES_SECTION = (325, f": invalid sections on {COMMA_SEPARATED_VALUES}:")
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.171900 #1] INFO -- : Skipping file ./src/nitpick/plugins/info.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 21
project: Project
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.173890 #1] INFO -- : Skipping file ./src/nitpick/typedefs.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 23
mypy_property: Any = property
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.186356 #1] INFO -- : Skipping file ./src/nitpick/flake8.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 32
def run(self) -> Iterator[Flake8Error]:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.199225 #1] INFO -- : Skipping file ./src/nitpick/generic.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 26
def relative_to_current_dir(path_or_str: PathOrStr | None) -> str:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.201590 #1] INFO -- : Skipping file ./src/nitpick/tomlkit_ext.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 29
def _replace_toml_document_getitem(original_method: Callable) -> Callable:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.214052 #1] INFO -- : Skipping file ./src/nitpick/cli.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 55
f"--{Flake8OptionEnum.OFFLINE.name.lower()}", # pylint: disable=no-member
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.279464 #1] INFO -- : Skipping file ./src/nitpick/constants.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 65
*ROOT_PYTHON_FILES,
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.289370 #1] INFO -- : Skipping file ./src/nitpick/config.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 12
from_plugin: JsonDict = Factory(dict)
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.302182 #1] INFO -- : Skipping file ./src/nitpick/blender.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 56
actual: list | dict, expected: list | dict, *, return_list: bool = True
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.309946 #1] INFO -- : Skipping file ./src/nitpick/core.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 61
project: Project
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.314205 #1] INFO -- : Skipping file ./src/nitpick/exceptions.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 19
def __init__(self, violations: Fuss | list[Fuss]) -> None:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.320992 #1] INFO -- : Skipping file ./src/nitpick/violations.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 28
fixed: bool
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.325278 #1] INFO -- : Skipping file tasks.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 27
def __init__(self) -> None:
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.335875 #1] INFO -- : Skipping file ./docs/ideas/lab.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 18
print(f"\nExpression: {expression}")
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.337426 #1] INFO -- : Skipping file ./docs/conf.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 198
latex_elements: dict[str, str] = {
^
SyntaxError: invalid syntax
I, [2024-11-25T21:33:12.346476 #1] INFO -- : Skipping file ./docs/autofix_docs.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
print(json.dumps(to_json(ast.parse(source))))
File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 43
DOCS_DIR: Path = Path(__file__).parent.absolute()
^
SyntaxError: invalid syntax
|
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: 176 files indexed
ERROR: Unable to parse file: /code/src/nitpick/style.py
ERROR: Parse error at line 140 column 11:
130:
131: logger.warning(f"Invalid cache option: {clean_cache_option}. Defaulting to 1 hour")
132:
133: returncaching,expires_after
134:
135:
136: @dataclass()
137: class StyleManager:
138: """Include styles recursively from one another."""
139:
--> project: Project
141: offline: bool
142: cache_option: str
143:
144: _cache_dir: Path = field(init=False)
145: _fixed_name_classes: set = field(init=
ERROR: Unable to parse file: /code/src/nitpick/plugins/toml.py
ERROR: Parse error at line 33 column 17:
15:
16: from tomlkit.toml_document import TOMLDocument
17:
18: from nitpick.plugins.info import FileInfo
19:
20:
21: class TomlPlugin(NitpickPlugin):
22: """Enforce configurations and autofix TOML files.
23:
24: E.g.: `pyproject.toml (PEP 518) <https://www.python.org/dev/peps/pep-0518/#file-format>`_.
25:
26: See also `the [tool.poetry] section of the pyproject.toml file
27: <https://github.com/python-poetry/poetry/blob/master/docs/pyproject.md>`_.
28:
29: Style example: :gitref:`Python 3.8 version constraint <src/nitpick/resources/python/38.toml>`.
30: There are :ref:`many other examples here <library>`.
31: """
32:
--> identify_tags: ClassVar = {"toml"}
34: violation_base_code = 310
35: fixable = True
36:
37: def enforce_rules(self) -> Iterator[Fuss]:
38: """Enforce rules for missing key/value pairs in the TOML file."""
ERROR: Unable to parse file: /code/src/nitpick/plugins/yaml.py
ERROR: Parse error at line 53 column 17:
22: = "hooks"
23: KEY_ID = "id"
24: KEY_REPO = "repo"
25: KEY_REPOS = "repos"
26: KEY_YAML = "yaml"
27:
28:
29:
30: class YamlPlugin(NitpickPlugin):
31: """Enforce configurations and autofix YAML files.
32:
33: - Example: `.pre-commit-config.yaml <https://pre-commit.com/#pre-commit-configyaml---top-level>`_.
34: - Style example: :gitref:`the default pre-commit hooks <src/nitpick/resources/any/pre-commit-hooks.toml>`.
35:
36: .. warning::
37:
38: The plugin tries to preserve comments in the YAML file by using the ``ruamel.yaml`` package.
39: It works for most cases.
40: If your comment was removed, place them in a different place of the fil and try again.
41: If it still doesn't work, please :issue:`report a bug <new/choose>`.
42:
43: Known issue: lists like ``args`` and ``additional_dependencies`` might be joined in a single line,
44: and comments between items will be removed.
45: Move your comments outside these lists, and they should be preserved.
46:
47: .. note::
48:
49: No validation of ``.pre-commit-config.yaml`` will be done anymore in this generic YAML plugin.
50: Nitpick will not validate hooks and missing keys as it did before; it's not the purpose of this package.
51: """
52:
--> identify_tags: ClassVar = {"yaml"}
54: violation_base_code = 360
55: fixable = True
56:
57: def predefined_special_config(self) -> SpecialConfig:
58: """Predefined special config, with list keys for .pre-commit-config.yaml and GitHub Workflow files."""
59: spc =
ERROR: Unable to parse file: /code/src/nitpick/plugins/text.py
ERROR: Parse error at line 57 column 17:
37: class Violations(ViolationEnum):
38: """Violations for this plugin."""
39:
40: MISSING_LINES = (352, " has missing lines:")
41:
42:
43: class TextPlugin(NitpickPlugin):
44: """Enforce configuration on text files.
45:
46: To check if ``some.txt`` file contains the lines ``abc`` and ``def`` (in any order):
47:
48: .. code-block:: toml
49:
50: [["some.txt".contains]]
51: line = "abc"
52:
53: [["some.txt".contains]]
54: line = "def"
55: """
56:
--> identify_tags: ClassVar = {"text"}
58: validation_schema = TextSchema
59:
60:
61:
62: skip_empty_suggestion = True
63:
64: violation_base_code = 350
65:
66: def _expected_lines(self):
67: return [obj
ERROR: Unable to parse file: /code/src/nitpick/plugins/base.py
ERROR: Parse error at line 37 column 23:
23:
24:
25:
26: class NitpickPlugin(metaclass=abc.ABCMeta):
27: """Base class for Nitpick plugins.
28:
29: :param data: File information (project, path, tags).
30: :param expected_config: Expected configuration for the file
31: :param autofix: Flag to modify files, if the plugin supports it (default: True).
32: """
33:
34: __str__, __unicode__ = autotext("{self.info.path_from_root} ({self.__class__.__name__})")
35:
36: filename = ""
--> violation_base_code: int = 0
38:
39:
40: fixable: bool = False
41:
42:
43:
44: validation_schema: Schema | None = None
45:
46:
47: identify_tags: ClassVar = set()
48:
49: skip_empty_suggestion = False
ERROR: Unable to parse file: /code/src/nitpick/plugins/json.py
ERROR: Parse error at line 42 column 17:
31: = fields.Dict(fields.NonEmptyString, fields.JsonString)
32:
33:
34: class JsonPlugin(NitpickPlugin):
35: """Enforce configurations and autofix JSON files.
36:
37: Add the configurations for the file name you wish to check.
38: Style example: :gitref:`the default config for package.json <src/nitpick/resources/javascript/package-json.toml>`.
39: """
40:
41: validation_schema = JsonFileSchema
--> identify_tags: ClassVar = {"json"}
43: violation_base_code = 340
44: fixable = True
45:
46: def enforce_rules(self) -> Iterator[Fuss]:
47: """Enforce rules for missing keys and JSON content."""
ERROR: Unable to parse file: /code/src/nitpick/plugins/ini.py
ERROR: Parse error at line 52 column 17:
33: (327, ": {key} is {actual} but it should be:")
34: TOP_SECTION_MISSING_OPTION = (328, ": top section has missing options. Use this:")
35:
36:
37: class IniPlugin(NitpickPlugin):
38: """Enforce configurations and autofix INI files.
39:
40: Examples of ``.ini`` files handled by this plugin:
41:
42: - `setup.cfg <https://docs.python.org/3/distutils/configfile.html>`_
43: - `.editorconfig <https://editorconfig.org/>`_
44: - `tox.ini <https://github.com/tox-dev/tox>`_
45: - `.pylintrc <https://pylint.readthedocs.io/en/latest/user_guide/usage/run.html#command-line-options>`_
46:
47: Style examples enforcing values on INI files: :gitref:`flake8 configuration
48: <src/nitpick/resources/python/flake8.toml>`.
49: """
50:
51: fixable = True
--> identify_tags: ClassVar = {"ini", "editorconfig"}
53: violation_base_code = 320
54:
55: updater: ConfigUpdater
56: comma_separated_values: set[str]
57:
58: def post_init(self):
ERROR: Unable to parse file: /code/src/nitpick/plugins/info.py
ERROR: Parse error at line 21 column 11:
11: nitpick.exceptions import Deprecation
12:
13: if TYPE_CHECKING:
14: from nitpick.core import Project
15:
16:
17: @dataclass
18: class FileInfo:
19: """File information needed by the plugin."""
20:
--> project: Project
22: path_from_root: str
23: tags: set[str] = field(default_factory=set)
24:
25: @classmethod
26: def create(cls, project
ERROR: Unable to parse file: /code/src/nitpick/typedefs.py
ERROR: Parse error at line 23 column 13:
16: str]]
17: YamlObject = Union[CommentedSeq, CommentedMap]
18: YamlValue = Union[JsonDict, List[Any], str, float]
19:
20:
21:
22:
--> mypy_property: Any = property
24: EOF
ERROR: Unable to parse file: /code/src/nitpick/flake8.py
ERROR: Parse error at line 52 column 24:
47: ) -> Iterator[Fuss]:
48: """Collect all possible Nitpick errors."""
49: nit = Nitpick.singleton()
50:
51: current_python_file = Path(self.filename)
--> main_python_file: Path = find_main_python_file(nit.project.root)
53: if current_python_file.absolute() != main_python_file.absolute():
54:
55: logger.debug
ERROR: Unable to parse file: /code/src/nitpick/tomlkit_ext.py
ERROR: Parse error at line 77 column 25:
75: Container, marker: str, start_index: int) -> tuple[int, int | None, int | None]:
76: """Find comment markers before an index; only search comments and whitespace."""
--> previous_object_index: int = -1
78: marker_start: int | None = None
79: marker_end: int | None = None
80: current_index = start_index - 1
81: while current_index
ERROR: Unable to parse file: /code/src/nitpick/cli.py
ERROR: Parse error at line 72 column 16:
69: context.parent:
70: project = context.parent.params["project"]
71: offline = context.parent.params["offline"]
--> project_root: Path | None = Path(project) if project else None
73: return Nitpick.singleton().init(project_root, offline)
74:
75:
76: def
ERROR: Unable to parse file: /code/src/nitpick/constants.py
ERROR: Parse error at line 108 column 8:
96:
97: GREEN_CHECK = "✅"
98: QUESTION_MARK = "❓"
99: SLEEPY_FACE = "😴"
100: STAR_CAKE = "✨ 🍰 ✨"
101: X_RED_CROSS = "❌"
102:
103:
104:
105: class _OptionMixin:
106: """Private mixin used to test the CLI options."""
107:
--> name: str
109:
110: def as_flake8_flag(self) -> str:
111: """Format the name of a flag to be used on the CLI."""
112: slug = self.name.lower().replace("_",
ERROR: Unable to parse file: /code/src/nitpick/config.py
ERROR: Parse error at line 12 column 15:
1: """Special configurations."""
2:
3: from attr import Factory, define
4:
5: from nitpick.typedefs import JsonDict
6:
7:
8: @define
9: class OverridableConfig:
10: """Configs formed from defaults from the plugin that can be overridden by the style."""
11:
--> from_plugin: JsonDict = Factory(dict)
13: from_style: JsonDict = Factory(dict)
14: value: JsonDict = Factory(dict)
15:
16:
17: @define
18:
ERROR: Unable to parse file: /code/src/nitpick/blender.py
ERROR: Parse error at line 115 column 8:
106: :
107: rv = jmespath_expression.search(json_data)
108: return rv or default
109:
110:
111: @define
112: class ElementDetail:
113: """Detailed information about an element of a list."""
114:
--> data: ElementData
116: key: str | list[str]
117: index: int
118: scalar: bool
119: compact: str
120:
121: @property
122: def cast_to_dict(
ERROR: Unable to parse file: /code/src/nitpick/core.py
ERROR: Parse error at line 61 column 11:
50: , StyleViolations
51:
52: if TYPE_CHECKING:
53: from nitpick.typedefs import JsonDict, PathOrStr
54:
55:
56: class Nitpick:
57: """The Nitpick API."""
58:
59: _allow_init = False
60:
--> project: Project
62:
63: def __init__(self) -> None:
64: if not self._allow_init:
65: msg = "This class cannot be instantiated directly. Use Nitpick.singleton().init(...) instead"
66: raise TypeError(msg
ERROR: Unable to parse file: /code/src/nitpick/exceptions.py
ERROR: Parse error at line 21 column 23:
19: __init__(self, violations: Fuss | list[Fuss]) -> None:
20: super().__init__()
--> self.violations: list[Fuss] = list(always_iterable(violations))
22:
23:
24: class Deprecation:
25: """All deprecation messages in a single class.
26:
27: When it's time to break compatibility, remove a method/warning below,
28: and older config files will trigger validation errors on Nitpick.
29: """
30:
31: @staticmethod
32: def pre_commit_without_dash(path_from_root
ERROR: Unable to parse file: /code/src/nitpick/violations.py
ERROR: Parse error at line 28 column 9:
16: TYPE_CHECKING:
17: from nitpick.plugins.info import FileInfo
18:
19:
20: @dataclass(frozen=True)
21: class Fuss:
22: """Nitpick makes a fuss when configuration doesn't match.
23:
24: Fields inspired on :py:class:`SyntaxError` and `pyflakes.messages.Message
25: <https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py#L6>`_.
26: """
27:
--> fixed: bool
29: filename: str
30: code: int
31: message: str
32: suggestion: str = ""
33: lineno: int = 1
34:
35: @property
36:
ERROR: Unable to parse file: /code/docs/conf.py
ERROR: Parse error at line 198 column 14:
154: }.items()
155: for identifier in identifiers
156: ]
157:
158:
159:
160:
161:
162:
163:
164: html_theme = "sphinx_rtd_theme"
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175: html_static_path = ["_static"]
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188: html_last_updated_fmt = ""
189:
190:
191:
192:
193: htmlhelp_basename = "nitpickdoc"
194:
195:
196:
197:
--> latex_elements: dict[str, str] = {
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211: }
212:
213:
214:
215:
216: latex_documents = [(master_doc, "nitpick.tex", "nitpick Documentation", "W. Augusto Andreoli", "manual")]
217:
218:
219:
220:
221:
222:
223: man_pages = [
ERROR: Unable to parse file: /code/docs/ideas/lab.py
ERROR: Parse error at line 51 column 14:
47: "*.toml")):
48: click.secho(str(path), fg="green")
49:
50: toml_doc = TomlDoc(path=path)
--> config: dict = toml_doc.as_object[".github/workflows/python.yaml"]
52:
53:
54:
55:
56: click.secho("JSON", fg="yellow")
57: print(json.dumps(config, indent
ERROR: Unable to parse file: /code/docs/autofix_docs.py
ERROR: Parse error at line 43 column 8:
34: .style import BuiltinStyle, builtin_styles, repo_root
35:
36: RST_DIVIDER_FROM_HERE = ".. auto-generated-from-here"
37: RST_DIVIDER_START = ".. auto-generated-start-{}"
38: RST_DIVIDER_END = ".. auto-generated-end-{}"
39:
40: MD_DIVIDER_START = "<!-- auto-generated-start-{} -->"
41: MD_DIVIDER_END = "<!-- auto-generated-end-{} -->"
42:
--> DOCS_DIR: Path = Path(__file__).parent.absolute()
44: CLI_MAPPING = [
45: ("", "Main options", ""),
46: (
47: "fix",
48: "Modify files directly",
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.511s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------
|