Skip to content

Commit f97e211

Browse files
committed
Add performance TODOs and restrictions
1 parent 8fc9d25 commit f97e211

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

TODO.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@
4040
- [ ] Configurable logging (log levels for debugging and k/v log values)
4141
- [ ] Add `init` command to create a default named config file
4242
- [ ] Remove panics that are poor programming style
43-
- [ ] Add testing for config files... lines, path
44-
- [ ] Setup goreleaser for releases
43+
- [x] Add testing for config files... lines, path
44+
- [x] Setup goreleaser for releases
4545
- [ ] Setup version bumper
46-
- [ ] Ensure version is embedded into cobra cli and available for --version
46+
- [x] Ensure version is embedded into cobra cli and available for --version
4747
- [ ] Add way to pipe to exec process and non-zero exit is a failing to provide builtin, js, exec mechanisms
48-
- [ ] Setup version reading https://goreleaser.com/cookbooks/using-main.version/
48+
- [x] Setup version reading https://goreleaser.com/cookbooks/using-main.version/
49+
- [x] Add this as a hermit-package in zph/hermit-packages
50+
51+
## Performance
52+
- [ ] Setup support for gitignore and global gitignore to avoid reading things like node_modules :yawning_face:
53+
- [ ] Setup parallelism for larger repos
54+
- [ ] Requires reworking how we use goja functions because those VMs are not thread safe
55+
- [ ] Could setup a worker pool of VMs? Or could provision new VM for each fn call....

cmd/run.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ func Run(cmd *cobra.Command, args []string) (int, []error) {
4949
return err
5050
}
5151

52-
// Check if the file has the extension
52+
// Causes 4x slowdown in benchmarks on project with large node_modules folder
53+
// if we use IsRegular() instead of isDir()
54+
// Regular mode = non-dir, non-symlink etcs
55+
// TODO(zph) investigate this issue and find a better solution
5356
if !info.IsDir() {
5457
content, err := os.ReadFile(path)
5558

@@ -66,7 +69,6 @@ func Run(cmd *cobra.Command, args []string) (int, []error) {
6669
if len(result.Findings) > 0 {
6770
fmt.Printf("\n%s: violations count %d\n", result.Path, len(result.Findings))
6871
for idx, finding := range result.Findings {
69-
// TODO: figure out why the rule embedded is wrong
7072
fmt.Printf("%d: Line %3d %30s %20s\n", idx+1, finding.LineNo, finding.RuleId, finding.Rule.Description)
7173
}
7274
exitCode = 1

0 commit comments

Comments
 (0)