Commit a003d11
committed
Use .gitignore as part of the excluded file list
When using Bandit to scan projects based on Git source control,
it would be benefitual to ignore files based on the patterns
in the .gitignore file.
Today, Bandit has some default excludes that get overridden if
a user passes in other excludes. This is a bit confusing to the
end user. But it also serves a purpose similar to .gitignore in
that the paths excluded by default are typically included in a
.gitignore.
Note, it will only check for .gitignore files in top-level directories
specified on the Bandit command line as targets. It does not recursive
look for .gitignore files. This is done because recursive searching
for .gitignore files would be complex to add to Bandit existing
file discovery.
This change adds a new Apache 2 licensed dependency of ignorelib.
Fixes #826
Signed-off-by: Eric Brown <[email protected]>1 parent 0779eb0 commit a003d11
File tree
5 files changed
+27
-10
lines changed- bandit
- cli
- core
- doc/source/man
- tests/unit/core
5 files changed
+27
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
| 230 | + | |
228 | 231 | | |
229 | | - | |
| 232 | + | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
241 | | - | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
365 | 368 | | |
366 | 369 | | |
367 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
368 | 380 | | |
369 | | - | |
| 381 | + | |
370 | 382 | | |
371 | 383 | | |
372 | 384 | | |
| |||
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
379 | | - | |
| 391 | + | |
380 | 392 | | |
381 | 393 | | |
382 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
0 commit comments