Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comby ignores files in current dir or explicitly provided dir when its hidden #352

Open
tekumara opened this issue Nov 28, 2022 · 3 comments

Comments

@tekumara
Copy link

Describe the bug

When using templates and the current directory is a hidden directory (or the -d dir is hidden) comby ignores the files.

Reproducing

❯ pwd
/Users/tekumara/code/myapp/.teamcity
❯ ll
total 40
-rw-r--r--  1 tekumara  staff   4.5K 24 Jun 11:06 settings.kts
❯ comby -config ../comby-patch-settings.toml -f .kts -stats
{
  "number_of_files": 0,
  "lines_of_code": 0,
  "number_of_matches": 0,
  "total_time": 40.49396514892578
}
❯ cd ..
❯ pwd
/Users/tekumara/code/myapp
❯ comby -config ../comby-patch-settings.toml -f .kts -stats -d .teamcity
{
  "number_of_files": 0,
  "lines_of_code": 0,
  "number_of_matches": 0,
  "total_time": 40.49396514892578
}

Expected behavior

When using templates, and the current dir is a hidden directory, or a hidden directory is explicitly provided via -d then comby should work on this files.

Additional context

comby 1.8.1

@tekumara
Copy link
Author

A work around whilst there's no fix is to provide an empty template and the explicit file names, which produces a warning but will work on the files in the hidden directory:

❯ comby -config comby-patch-teamcity.toml -matcher .txt -f .kts "" "" .teamcity/* -stats
WARNING: Templates specified on the command line AND using -templates. Ignoring match
      and rewrite templates on the command line and only using those in directories.
....      
{
  "number_of_files": 1,
  "lines_of_code": 285,
  "number_of_matches": 0,
  "total_time": 92.39006042480469
}

@rvantonder
Copy link
Member

rvantonder commented Nov 29, 2022

Thanks--looks like this conflicts with --exclude-dir which by default excludes any directories starting with ..

When a flag specifies -d explicitly, I agree it should just work.

In the mean time you can probably use the workaround --exclude-dir "" -d .teamcity (didn't check, but it should work)

@tekumara
Copy link
Author

tekumara commented Dec 6, 2022

Thanks for looking into this! When I try -exclude-dir "" I get:

Error parsing command line:

  failed to parse -exclude-dir value "".
  (Failure "Command.Spec.Arg_type.comma_separated: empty list not allowed")

For usage information, run

  comby -help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants