cqfn / pdd

Command line toolkit for collecting TODO markers from your code, known as Puzzle Driven Development (PDD)
https://www.0pdd.com
MIT License
76 stars 25 forks source link

Misleading description or behavior of the --skip-gitignore option #221

Open php-coder opened 1 year ago

php-coder commented 1 year ago
# pdd --version
0.23.1
# pdd --help | grep gitignore
    --skip-gitignore  Don't look into .gitignore for excludes

The description makes me think that inspecting of .gitignore is enabled by default and this behavior can be disabled with the option. In fact, pdd disrespects my .gitignore and this option enables looking into .gitignore file.

Here is how I reproduced this:

# pdd -f pdd.xml -v
Found 1 lines in /data/mystamps/.pdd
My version is 0.23.1
Ruby version is 2.7.8 at x86_64-linux
Reading from root dir /data/mystamps
Excluding src/test/wiremock/**/*
...
/data/mystamps/target/mystamps.war.original is a binary file (34117363 bytes)
...
# pdd -f pdd.xml -v --skip-gitignore
Found 1 lines in /data/mystamps/.pdd
My version is 0.23.1
Ruby version is 2.7.8 at x86_64-linux
Reading from root dir /data/mystamps
Excluding src/test/wiremock/**/*
Excluding target/
...
# grep target .gitignore
target/
php-coder commented 7 months ago

@yegor256 @pnatashap WDYT about this bug?

proofit404 commented 5 months ago

This got me tricked as well. Probably, it's not the best name for such option. ESLint for example uses --ignore-path.

Maybe it's better to --exclude-file=.gitignore?

pnatashap commented 5 months ago

@php-coder you can introduce more clear description. The meaning of this option is skipping search for puzzles in files mentioned in .gitignore. exclude is an additional parameter to skip some files, but in gitignore we typically place all paths with binaries.