Skip to content

Output format inconsistent in tach check --output jsonΒ #680

@pavelzw

Description

@pavelzw

The output format of tach check --output json is inconsistent.
Sometimes i get things like this:

❯ tach check --output json
[
  {
    "Located": {
      "file_path": "my_package/def.py",
      "line_number": 1,
      "original_line_number": 1,
      "severity": "Error",
      "details": {
        "Code": {
          "UndeclaredDependency": {
            "dependency": "my_package.abc.*",
            "usage_module": "my_package.def",
            "definition_module": "my_package.abc"
          }
        }
      }
    }
  }
]

After running tach sync and then tach check --output json again, i get this:

❯ tach check --output json
{"error": "Circular dependency", "dependencies": ["my_package.def", "my_package.abc"]}

This leads to it not being possible to process these things nicely using tach check --output json | jq .error for example.

also, one is pretty-printed and one is not. having this consistent would be nice IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions