Skip to content

Commit

Permalink
Add FD version number to JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
jherland committed Feb 23, 2023
1 parent b4d89ca commit 98032b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions fawltydeps/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Analysis:
declared_deps: Optional[List[DeclaredDependency]] = None
undeclared_deps: Optional[List[UndeclaredDependency]] = None
unused_deps: Optional[List[UnusedDependency]] = None
version: str = version()

def is_enabled(self, *args: Action) -> bool:
"""Return True if any of the given actions are in self.settings."""
Expand Down
5 changes: 4 additions & 1 deletion tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import pytest

from fawltydeps.main import VERBOSE_PROMPT
from fawltydeps.main import VERBOSE_PROMPT, version

from .test_extract_imports_simple import generate_notebook

Expand Down Expand Up @@ -172,6 +172,7 @@ def test_list_imports_json__from_py_file__prints_imports_from_file(write_tmp_fil
"declared_deps": None,
"undeclared_deps": None,
"unused_deps": None,
"version": version(),
}
output, _errors, returncode = run_fawltydeps(
"--list-imports", "--json", f"--code={tmp_path}/myfile.py"
Expand Down Expand Up @@ -318,6 +319,7 @@ def test_list_deps_json__dir__prints_deps_from_requirements_txt(
],
"undeclared_deps": None,
"unused_deps": None,
"version": version(),
}
output, _errors, returncode = run_fawltydeps(
"--list-deps", "--json", f"--deps={tmp_path}"
Expand Down Expand Up @@ -572,6 +574,7 @@ def test_check_json__simple_project__can_report_both_undeclared_and_unused(
],
},
],
"version": version(),
}
output, _errors, returncode = run_fawltydeps(
"--check", "--json", f"--code={tmp_path}", f"--deps={tmp_path}"
Expand Down

0 comments on commit 98032b4

Please sign in to comment.