Commit b72d7b0
committed
refactor: replace args usage with ScanConfig in sbomgen invocation
- Replace args.sbomgen_version with config.sbomgen_version in logging
- Replace args.timeout with str(config.timeout) for command line argument
- Replace string-based scanner logic with type-safe list operations:
- args.scanners != "''" → config.scanners (truthy list check)
- args.skip_scanners != "''" → config.skip_scanners (truthy list check)
- args.skip_files != "''" → config.skip_files (truthy list check)
- Convert lists back to comma-separated strings for sbomgen command
- Add comprehensive test coverage for field access patterns
Benefits:
- Eliminates error-prone string comparisons with "''"
- Uses proper list operations instead of string parsing
- Type-safe field access with explicit data conversion
- Cleaner, more readable conditional logic
Continues strangler fig migration - old and new code coexist safely
while gradually improving code quality and maintainability.1 parent 4312258 commit b72d7b0
File tree
2 files changed
+34
-11
lines changed- entrypoint
- entrypoint
- tests
2 files changed
+34
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | | - | |
192 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
193 | 194 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
197 | 199 | | |
198 | | - | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
203 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
204 | 207 | | |
205 | | - | |
| 208 | + | |
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
0 commit comments