Commit 75df672
Clean up Generate function in report.go (#992)
* Clean up Generate function in report.go
Broken down the functionality of the generate function into modular functions:
`buildIgnoreMap()` — creates the ignore tag map
`trimDisplayPath()` — handles trimming file paths
`initFileReport()` — initializes the report struct
`createMatchRulesMap()` — Store match rules in a map
`processMatchedStrings()` — processes all pattern matches
`buildBehavior()` — creates a behavior object from rule data
`handleMetadata()` — processes metadata and applies overrides
`updateBehavior()` — updates behavior entries in the file report
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* formatting fix
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* fix typecheck error
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* fix formatting using gofumpt
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* Update programkind.go
- Moved the regex for checking the version outside `getExt` func for better performance
- Created slices to check for `.elf, .gzip, .Z` files using `bytes.hasPrefix`
- Wrote Equivalent code without an anonymous function in `GetExt` for extension of size greater than 2, which is more idiomatic.
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* fix missing pledges syscalls and caps
* fix golangci-lint
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
* WIP: saving before rebase
---------
Signed-off-by: Ritish Srivastava <121374890+Ritish134@users.noreply.github.com>
Co-authored-by: Evan Gibler <20933572+egibs@users.noreply.github.com>1 parent f6569b2 commit 75df672
2 files changed
Lines changed: 190 additions & 156 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| |||
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
141 | | - | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | | - | |
232 | | - | |
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
| |||
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 254 | + | |
258 | 255 | | |
259 | 256 | | |
260 | 257 | | |
| |||
289 | 286 | | |
290 | 287 | | |
291 | 288 | | |
292 | | - | |
| 289 | + | |
293 | 290 | | |
294 | 291 | | |
295 | 292 | | |
| |||
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
319 | | - | |
| 316 | + | |
320 | 317 | | |
321 | | - | |
| 318 | + | |
322 | 319 | | |
323 | 320 | | |
324 | 321 | | |
325 | 322 | | |
326 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
| |||
0 commit comments