TL;DR: Use --folders-to-skip
with a list of patterns for folder-names, not paths.
Example
We can't reproduce, because your question is missing an example folder structure. First let's create it with two simple Linux shell-commands (e.g. zsh, bash).
Next, we can test different arguments for the parameter --folders-to-skip
.
Create the sample directory structure
Create directories (2 levels deep):
$ mkdir -p pygount/src{1..3}/{A..C}
Then create the files, one in each directory:
$ touch pygount/src{1..3}/{A..C}/code.py
Now we have following structure:
$ tree pygount
pygount
├── src1
│ ├── A
│ │ └── code.py
│ ├── B
│ │ └── code.py
│ └── C
│ └── code.py
├── src2
│ ├── A
│ │ └── code.py
│ ├── B
│ │ └── code.py
│ └── C
│ └── code.py
└── src3
├── A
│ └── code.py
├── B
│ └── code.py
└── C
└── code.py
12 directories, 9 files
Using pygount, without skipping
The simple way, without skipping:
$ pygount --suffix=py pygount 0 __empty__ pygount pygount/src1/A/code.py
0 __empty__ pygount pygount/src1/B/code.py
0 __empty__ pygount pygount/src1/C/code.py
0 __empty__ pygount pygount/src2/A/code.py
0 __empty__ pygount pygount/src2/B/code.py
0 __empty__ pygount pygount/src2/C/code.py
0 __empty__ pygount pygount/src3/A/code.py
0 __empty__ pygount pygount/src3/B/code.py
0 __empty__ pygount pygount/src3/C/code.py
Issue: Just provide a single folder-name as pattern
PyGount doesn't work with paths for the parameter, like you may know from other Linux commands like ls
:
$ ls **/C pygount/src1/C:
code.py
pygount/src2/C:
code.py
pygount/src3/C:
code.py
See how a path given with --folders-to-skip='**/C'
doesn't get matched:
$ pygount --suffix=py --folders-to-skip='**/C' pygount 0 __empty__ pygount pygount/src1/A/code.py
0 __empty__ pygount pygount/src1/B/code.py
0 __empty__ pygount pygount/src1/C/code.py
0 __empty__ pygount pygount/src2/A/code.py
0 __empty__ pygount pygount/src2/B/code.py
0 __empty__ pygount pygount/src2/C/code.py
0 __empty__ pygount pygount/src3/A/code.py
0 __empty__ pygount pygount/src3/B/code.py
0 __empty__ pygount pygount/src3/C/code.py
Using pygount with skipped folder-names
Instead the folders to skip are expected as single folder-names given as list.
See the description for related parameter --names-to-skip
in the docs:
To specify alternative patterns, use --folders-to-skip
and --names-to-skip
. Both take a comma separated list of patterns, see below on the pattern syntax. To for example also prevent folders starting with two underscores (_) from being analyzed, specify --folders-to-skip=[...],__*
.
Now skipping inner folders named C
:
$ pygount --suffix=py --folders-to-skip='C' pygount 0 __empty__ pygount pygount/src1/A/code.py
0 __empty__ pygount pygount/src1/B/code.py
0 __empty__ pygount pygount/src2/A/code.py
0 __empty__ pygount pygount/src2/B/code.py
0 __empty__ pygount pygount/src3/A/code.py
0 __empty__ pygount pygount/src3/B/code.py
It skipped every folder, that has a name like C
, even recursively. So it yields the same effect like path **/C
.
Concept of globs
For the different concept of filename and path patterns (globbing) on Unix-like systems like glob, extended glob or globstar (**
) see also: