Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 30, 2024
1 parent bf1e838 commit dd652f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
8 changes: 2 additions & 6 deletions dvc/commands/ls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def fmt(entry):
if with_size or with_md5:
ui.table(
[
_format_entry(
entry, fmt, with_size=with_size, with_md5=with_md5
)
_format_entry(entry, fmt, with_size=with_size, with_md5=with_md5)
for entry in entries
]
)
Expand Down Expand Up @@ -143,9 +141,7 @@ def add_parser(subparsers, parent_parser):
),
)
list_parser.add_argument("--size", action="store_true", help="Show sizes.")
list_parser.add_argument(
"--md5", action="store_true", help="Show MD5 checksums."
)
list_parser.add_argument("--md5", action="store_true", help="Show MD5 checksums.")
list_parser.add_argument(
"path",
nargs="?",
Expand Down
13 changes: 3 additions & 10 deletions tests/func/test_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ def test_ls_repo_with_path_dir_dvc_only_empty(tmp_dir, dvc, scm):

assert Repo.ls(os.fspath(tmp_dir), path="folder", dvc_only=True) == []

assert (
Repo.ls(os.fspath(tmp_dir), path="empty_dvc_folder", dvc_only=True)
== []
)
assert Repo.ls(os.fspath(tmp_dir), path="empty_dvc_folder", dvc_only=True) == []


def test_ls_repo_with_path_subdir(tmp_dir, dvc, scm):
Expand Down Expand Up @@ -191,9 +188,7 @@ def test_ls_repo_with_path_subdir_dvc_only_recursive(tmp_dir, dvc, scm):

path = os.path.join("data", "subcontent")
files = Repo.ls(os.fspath(tmp_dir), path, dvc_only=True, recursive=True)
match_files(
files, ((("data.xml",), True), (("statistics", "data.csv"), True))
)
match_files(files, ((("data.xml",), True), (("statistics", "data.csv"), True)))


def test_ls_repo_with_path_file_out(tmp_dir, dvc, scm):
Expand Down Expand Up @@ -616,9 +611,7 @@ def _list_files(repo, path=None):
dvc_files = {"dvc_dir", "foo.txt", "foo.txt.dvc", "dvc_dir.dvc"}
common_outputs = git_tracked_outputs | extras | dvc_files

top_level_outputs = (
common_outputs if dvc_top_level else git_tracked_outputs
)
top_level_outputs = common_outputs if dvc_top_level else git_tracked_outputs
assert _list_files(erepo) == top_level_outputs
assert _list_files(erepo, "scm_dir") == {"ipsum"}
if dvc_top_level:
Expand Down

0 comments on commit dd652f2

Please sign in to comment.