|
35 | 35 | from pathlib import Path |
36 | 36 | import fnmatch |
37 | 37 |
|
38 | | -VERSION = "0.3.0" |
| 38 | +VERSION = "0.3.1" |
39 | 39 |
|
40 | 40 | # default blacklist |
41 | 41 | BLACKLIST = [ |
@@ -114,7 +114,6 @@ def is_binary(file_path): |
114 | 114 |
|
115 | 115 | def _apply_rules(file_name, content, rules): |
116 | 116 | import fnmatch |
117 | | - import re |
118 | 117 | import logging |
119 | 118 |
|
120 | 119 | for rule in rules: |
@@ -232,8 +231,6 @@ def scan_directory(directory, markdown_content, global_blacklist, global_rules): |
232 | 231 | rules = global_rules.copy() |
233 | 232 | blacklist = global_blacklist.copy() |
234 | 233 |
|
235 | | - # load_maid_conf(directory, blacklist, rules) |
236 | | - |
237 | 234 | for root, dirs, files in os.walk(directory): |
238 | 235 | local_blacklist = blacklist.copy() |
239 | 236 | local_rules = rules.copy() |
@@ -323,7 +320,12 @@ def main(): |
323 | 320 | for path in args.paths: |
324 | 321 | if os.path.isdir(path): |
325 | 322 | logging.info(f"Scanning directory: {path}") |
326 | | - scan_directory(path, markdown_content, blacklist, rules) |
| 323 | + _blacklist = blacklist.copy() |
| 324 | + _rules = rules.copy() |
| 325 | + |
| 326 | + load_maid_conf(path, _blacklist, _rules) |
| 327 | + |
| 328 | + scan_directory(path, markdown_content, _blacklist, _rules) |
327 | 329 | elif os.path.isfile(path): |
328 | 330 | if not is_blacklisted(path, blacklist): |
329 | 331 | logging.info(f"Processing file: {path}") |
|
0 commit comments