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 Oct 20, 2023
1 parent d75650a commit d795a26
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/setuptools_scm/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from setuptools_scm.discover import walk_potential_roots



def main(args: list[str] | None = None) -> int:
opts = _get_cli_opts(args)
inferred_root: str = opts.root or "."
Expand Down Expand Up @@ -82,7 +81,7 @@ def _get_cli_opts(args: list[str] | None) -> argparse.Namespace:
)
output_formats = ["json", "plain", "key-value"]
ls_parser.add_argument(
"-f",
"-f",
"--format",
type=str.casefold,
default="plain",
Expand All @@ -95,8 +94,8 @@ def _get_cli_opts(args: list[str] | None) -> argparse.Namespace:
type=str.casefold,
nargs="*",
help="display setuptools_scm settings according to query, "
"e.g. dist_name, do not supply an argument in order to "
"print a list of valid queries.",
"e.g. dist_name, do not supply an argument in order to "
"print a list of valid queries.",
)
return parser.parse_args(args)

Expand All @@ -108,12 +107,12 @@ def ls_command(opts, version: str, config: Configuration) -> int:
opts.no_version = True
sys.stderr.write("Available queries:\n\n")
opts.query = ["queries"]
data["queries"] = [ "files" ] + list(config.__dataclass_fields__.keys())
data["queries"] = ["files"] + list(config.__dataclass_fields__.keys())

if opts.query is None:
opts.query = [ "files" ]
opts.query = ["files"]

if "files" in opts.query:
if "files" in opts.query:
data["files"] = find_files(config.root)

for q in opts.query:
Expand Down

0 comments on commit d795a26

Please sign in to comment.