code-puppy 0.0.92__py3-none-any.whl → 0.0.94__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ from typing import Optional, Tuple
5
5
  from rapidfuzz.distance import JaroWinkler
6
6
  from rich.console import Console
7
7
 
8
+ from pathlib import Path
8
9
  # get_model_context_length will be imported locally where needed to avoid circular imports
9
10
 
10
11
  NO_COLOR = bool(int(os.environ.get("CODE_PUPPY_NO_COLOR", "0")))
@@ -43,48 +44,314 @@ def get_model_context_length() -> int:
43
44
  # Shared ignore patterns/helpers
44
45
  # -------------------
45
46
  IGNORE_PATTERNS = [
46
- "**/node_modules/**",
47
- "**/node_modules/**/*.js",
48
- "node_modules/**",
49
- "node_modules",
47
+ # Version control
50
48
  "**/.git/**",
51
49
  "**/.git",
52
50
  ".git/**",
53
51
  ".git",
52
+ "**/.svn/**",
53
+ "**/.hg/**",
54
+ "**/.bzr/**",
55
+ # Node.js / JavaScript / TypeScript
56
+ "**/node_modules/**",
57
+ "**/node_modules/**/*.js",
58
+ "node_modules/**",
59
+ "node_modules",
60
+ "**/npm-debug.log*",
61
+ "**/yarn-debug.log*",
62
+ "**/yarn-error.log*",
63
+ "**/pnpm-debug.log*",
64
+ "**/.npm/**",
65
+ "**/.yarn/**",
66
+ "**/.pnpm-store/**",
67
+ "**/coverage/**",
68
+ "**/.nyc_output/**",
69
+ "**/dist/**",
70
+ "**/dist",
71
+ "**/build/**",
72
+ "**/build",
73
+ "**/.next/**",
74
+ "**/.nuxt/**",
75
+ "**/out/**",
76
+ "**/.cache/**",
77
+ "**/.parcel-cache/**",
78
+ "**/.vite/**",
79
+ "**/storybook-static/**",
80
+ # Python
54
81
  "**/__pycache__/**",
55
82
  "**/__pycache__",
56
83
  "__pycache__/**",
57
84
  "__pycache__",
58
- "**/.DS_Store",
59
- ".DS_Store",
60
- "**/.env",
61
- ".env",
85
+ "**/*.pyc",
86
+ "**/*.pyo",
87
+ "**/*.pyd",
88
+ "**/.pytest_cache/**",
89
+ "**/.mypy_cache/**",
90
+ "**/.coverage",
91
+ "**/htmlcov/**",
92
+ "**/.tox/**",
93
+ "**/.nox/**",
94
+ "**/site-packages/**",
62
95
  "**/.venv/**",
63
96
  "**/.venv",
64
97
  "**/venv/**",
65
98
  "**/venv",
66
- "**/.idea/**",
67
- "**/.idea",
68
- "**/.vscode/**",
69
- "**/.vscode",
99
+ "**/env/**",
100
+ "**/ENV/**",
101
+ "**/.env",
102
+ "**/pip-wheel-metadata/**",
103
+ "**/*.egg-info/**",
70
104
  "**/dist/**",
71
- "**/dist",
105
+ "**/wheels/**",
106
+ # Java (Maven, Gradle, SBT)
107
+ "**/target/**",
108
+ "**/target",
72
109
  "**/build/**",
73
110
  "**/build",
74
- "**/*.pyc",
75
- "**/*.pyo",
76
- "**/*.pyd",
111
+ "**/.gradle/**",
112
+ "**/gradle-app.setting",
113
+ "**/*.class",
114
+ "**/*.jar",
115
+ "**/*.war",
116
+ "**/*.ear",
117
+ "**/*.nar",
118
+ "**/hs_err_pid*",
119
+ "**/.classpath",
120
+ "**/.project",
121
+ "**/.settings/**",
122
+ "**/bin/**",
123
+ "**/project/target/**",
124
+ "**/project/project/**",
125
+ # Go
126
+ "**/vendor/**",
127
+ "**/*.exe",
128
+ "**/*.exe~",
129
+ "**/*.dll",
77
130
  "**/*.so",
131
+ "**/*.dylib",
132
+ "**/*.test",
133
+ "**/*.out",
134
+ "**/go.work",
135
+ "**/go.work.sum",
136
+ # Rust
137
+ "**/target/**",
138
+ "**/Cargo.lock",
139
+ "**/*.pdb",
140
+ # Ruby
141
+ "**/vendor/**",
142
+ "**/.bundle/**",
143
+ "**/Gemfile.lock",
144
+ "**/*.gem",
145
+ "**/.rvm/**",
146
+ "**/.rbenv/**",
147
+ "**/coverage/**",
148
+ "**/.yardoc/**",
149
+ "**/doc/**",
150
+ "**/rdoc/**",
151
+ "**/.sass-cache/**",
152
+ "**/.jekyll-cache/**",
153
+ "**/_site/**",
154
+ # PHP
155
+ "**/vendor/**",
156
+ "**/composer.lock",
157
+ "**/.phpunit.result.cache",
158
+ "**/storage/logs/**",
159
+ "**/storage/framework/cache/**",
160
+ "**/storage/framework/sessions/**",
161
+ "**/storage/framework/testing/**",
162
+ "**/storage/framework/views/**",
163
+ "**/bootstrap/cache/**",
164
+ # .NET / C#
165
+ "**/bin/**",
166
+ "**/obj/**",
167
+ "**/packages/**",
168
+ "**/*.cache",
78
169
  "**/*.dll",
79
- "**/.*",
170
+ "**/*.exe",
171
+ "**/*.pdb",
172
+ "**/*.user",
173
+ "**/*.suo",
174
+ "**/.vs/**",
175
+ "**/TestResults/**",
176
+ "**/BenchmarkDotNet.Artifacts/**",
177
+ # C/C++
178
+ "**/*.o",
179
+ "**/*.obj",
180
+ "**/*.so",
181
+ "**/*.dll",
182
+ "**/*.a",
183
+ "**/*.lib",
184
+ "**/*.dylib",
185
+ "**/*.exe",
186
+ "**/CMakeFiles/**",
187
+ "**/CMakeCache.txt",
188
+ "**/cmake_install.cmake",
189
+ "**/Makefile",
190
+ "**/compile_commands.json",
191
+ "**/.deps/**",
192
+ "**/.libs/**",
193
+ "**/autom4te.cache/**",
194
+ # Perl
195
+ "**/blib/**",
196
+ "**/_build/**",
197
+ "**/Build",
198
+ "**/Build.bat",
199
+ "**/*.tmp",
200
+ "**/*.bak",
201
+ "**/*.old",
202
+ "**/Makefile.old",
203
+ "**/MANIFEST.bak",
204
+ "**/META.yml",
205
+ "**/META.json",
206
+ "**/MYMETA.*",
207
+ "**/.prove",
208
+ # Scala
209
+ "**/target/**",
210
+ "**/project/target/**",
211
+ "**/project/project/**",
212
+ "**/.bloop/**",
213
+ "**/.metals/**",
214
+ "**/.ammonite/**",
215
+ "**/*.class",
216
+ # Elixir
217
+ "**/_build/**",
218
+ "**/deps/**",
219
+ "**/*.beam",
220
+ "**/.fetch",
221
+ "**/erl_crash.dump",
222
+ "**/*.ez",
223
+ "**/doc/**",
224
+ "**/.elixir_ls/**",
225
+ # Swift
226
+ "**/.build/**",
227
+ "**/Packages/**",
228
+ "**/*.xcodeproj/**",
229
+ "**/*.xcworkspace/**",
230
+ "**/DerivedData/**",
231
+ "**/xcuserdata/**",
232
+ "**/*.dSYM/**",
233
+ # Kotlin
234
+ "**/build/**",
235
+ "**/.gradle/**",
236
+ "**/*.class",
237
+ "**/*.jar",
238
+ "**/*.kotlin_module",
239
+ # Clojure
240
+ "**/target/**",
241
+ "**/.lein-**",
242
+ "**/.nrepl-port",
243
+ "**/pom.xml.asc",
244
+ "**/*.jar",
245
+ "**/*.class",
246
+ # Dart/Flutter
247
+ "**/.dart_tool/**",
248
+ "**/build/**",
249
+ "**/.packages",
250
+ "**/pubspec.lock",
251
+ "**/*.g.dart",
252
+ "**/*.freezed.dart",
253
+ "**/*.gr.dart",
254
+ # Haskell
255
+ "**/dist/**",
256
+ "**/dist-newstyle/**",
257
+ "**/.stack-work/**",
258
+ "**/*.hi",
259
+ "**/*.o",
260
+ "**/*.prof",
261
+ "**/*.aux",
262
+ "**/*.hp",
263
+ "**/*.eventlog",
264
+ "**/*.tix",
265
+ # Erlang
266
+ "**/ebin/**",
267
+ "**/rel/**",
268
+ "**/deps/**",
269
+ "**/*.beam",
270
+ "**/*.boot",
271
+ "**/*.plt",
272
+ "**/erl_crash.dump",
273
+ # Common cache and temp directories
274
+ "**/.cache/**",
275
+ "**/cache/**",
276
+ "**/tmp/**",
277
+ "**/temp/**",
278
+ "**/.tmp/**",
279
+ "**/.temp/**",
280
+ "**/logs/**",
281
+ "**/*.log",
282
+ "**/*.log.*",
283
+ # IDE and editor files
284
+ "**/.idea/**",
285
+ "**/.idea",
286
+ "**/.vscode/**",
287
+ "**/.vscode",
288
+ "**/*.swp",
289
+ "**/*.swo",
290
+ "**/*~",
291
+ "**/.#*",
292
+ "**/#*#",
293
+ "**/.emacs.d/auto-save-list/**",
294
+ "**/.vim/**",
295
+ "**/.netrwhist",
296
+ "**/Session.vim",
297
+ "**/.sublime-project",
298
+ "**/.sublime-workspace",
299
+ # OS-specific files
300
+ "**/.DS_Store",
301
+ ".DS_Store",
302
+ "**/Thumbs.db",
303
+ "**/Desktop.ini",
304
+ "**/.directory",
305
+ "**/*.lnk",
306
+ # Common artifacts
307
+ "**/*.orig",
308
+ "**/*.rej",
309
+ "**/*.patch",
310
+ "**/*.diff",
311
+ "**/.*.orig",
312
+ "**/.*.rej",
313
+ # Backup files
314
+ "**/*~",
315
+ "**/*.bak",
316
+ "**/*.backup",
317
+ "**/*.old",
318
+ "**/*.save",
319
+ # Hidden files (but be careful with this one)
320
+ # "**/.*", # Commented out as it might be too aggressive
80
321
  ]
81
322
 
82
323
 
83
324
  def should_ignore_path(path: str) -> bool:
84
325
  """Return True if *path* matches any pattern in IGNORE_PATTERNS."""
326
+ # Convert path to Path object for better pattern matching
327
+ path_obj = Path(path)
328
+
85
329
  for pattern in IGNORE_PATTERNS:
86
- if fnmatch.fnmatch(path, pattern):
87
- return True
330
+ # Try pathlib's match method which handles ** patterns properly
331
+ try:
332
+ if path_obj.match(pattern):
333
+ return True
334
+ except ValueError:
335
+ # If pathlib can't handle the pattern, fall back to fnmatch
336
+ if fnmatch.fnmatch(path, pattern):
337
+ return True
338
+
339
+ # Additional check: if pattern contains **, try matching against
340
+ # different parts of the path to handle edge cases
341
+ if "**" in pattern:
342
+ # Convert pattern to handle different path representations
343
+ simplified_pattern = pattern.replace("**/", "").replace("/**", "")
344
+
345
+ # Check if any part of the path matches the simplified pattern
346
+ path_parts = path_obj.parts
347
+ for i in range(len(path_parts)):
348
+ subpath = Path(*path_parts[i:])
349
+ if fnmatch.fnmatch(str(subpath), simplified_pattern):
350
+ return True
351
+ # Also check individual parts
352
+ if fnmatch.fnmatch(path_parts[i], simplified_pattern):
353
+ return True
354
+
88
355
  return False
89
356
 
90
357
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.92
3
+ Version: 0.0.94
4
4
  Summary: Code generation agent
5
5
  Author: Michael Pfaffenberger
6
6
  License: MIT
@@ -20,13 +20,13 @@ code_puppy/command_line/prompt_toolkit_completion.py,sha256=De_grHDPOvCRph-HDOGC
20
20
  code_puppy/command_line/utils.py,sha256=7eyxDHjPjPB9wGDJQQcXV_zOsGdYsFgI0SGCetVmTqE,1251
21
21
  code_puppy/tools/__init__.py,sha256=WTHYIfRk2KMmk6o45TELpbB3GIiAm8s7GmfJ7Zy_tww,503
22
22
  code_puppy/tools/command_runner.py,sha256=9UWCSPpuEndaPx8Ecc8TRsn3rMHNd2AqerirvYPGRIw,14358
23
- code_puppy/tools/common.py,sha256=fQL5ub2HgAo_s8RCeQFYwmALgrPfkUi35Q0InK4_7lE,3249
23
+ code_puppy/tools/common.py,sha256=UeZ2ABUjz9CilpbqquOLy20QU5NFPrOSpnT8kOO3JGc,9334
24
24
  code_puppy/tools/file_modifications.py,sha256=BzQrGEacS2NZr2ru9N30x_Qd70JDudBKOAPO1XjBohg,13861
25
25
  code_puppy/tools/file_operations.py,sha256=htrdURR1mBqBUja1mAHLlySwFN6xNHeGdYbg5eLiOug,13533
26
26
  code_puppy/tools/token_check.py,sha256=F3eygdI8fgb6dfCrSkGw_OLI7cb_Kpa5ILft4BQ7hvY,525
27
- code_puppy-0.0.92.data/data/code_puppy/models.json,sha256=jr0-LW87aJS79GosVwoZdHeeq5eflPzgdPoMbcqpVA8,2728
28
- code_puppy-0.0.92.dist-info/METADATA,sha256=gBLvPgAiTg5Ut7rMaBA_wiyVV3pGDe8yBy-TrUJDuRk,6319
29
- code_puppy-0.0.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
- code_puppy-0.0.92.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
31
- code_puppy-0.0.92.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
32
- code_puppy-0.0.92.dist-info/RECORD,,
27
+ code_puppy-0.0.94.data/data/code_puppy/models.json,sha256=jr0-LW87aJS79GosVwoZdHeeq5eflPzgdPoMbcqpVA8,2728
28
+ code_puppy-0.0.94.dist-info/METADATA,sha256=z016p8X0_n-vT1GbNSjVvFEjg6VnKQwVYwoUpkwnXyY,6319
29
+ code_puppy-0.0.94.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
30
+ code_puppy-0.0.94.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
31
+ code_puppy-0.0.94.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
32
+ code_puppy-0.0.94.dist-info/RECORD,,