Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic in protolint --fix #409

Open
amanakin opened this issue Jun 6, 2024 · 0 comments
Open

panic in protolint --fix #409

amanakin opened this issue Jun 6, 2024 · 0 comments

Comments

@amanakin
Copy link

amanakin commented Jun 6, 2024

MRE:

syntax = "proto3";

package example;

message ExampleMessage {
  /* ? */repeated/* ? */ bool boolean = 1;
}

Command:
./protolint --fix ./example.proto

Result:

panic: runtime error: slice bounds out of range [9:2]

goroutine 1 [running]:
github.com/yoheimuta/protolint/internal/addon/rules.indentVisitor.fix.func1({0x140002a6b80?, 0x8, 0x104737ed8?})
	/Users/amanakin/projects/protolint/internal/addon/rules/indentRule.go:384 +0x5a4
github.com/yoheimuta/protolint/linter/fixer.(*BaseFixing).ReplaceAll(0x14000181040, 0x14000293340)
	/Users/amanakin/projects/protolint/linter/fixer/fixer.go:88 +0x5c
github.com/yoheimuta/protolint/internal/addon/rules.indentVisitor.fix({0x140001c3160, {0x1046509ae, 0x2}, 0x0, 0x1, 0x0, 0x1400029cf30})
	/Users/amanakin/projects/protolint/internal/addon/rules/indentRule.go:358 +0xd4
github.com/yoheimuta/protolint/internal/addon/rules.indentVisitor.Finally(...)
	/Users/amanakin/projects/protolint/internal/addon/rules/indentRule.go:103
github.com/yoheimuta/protolint/linter/visitor.(*extendedAutoDisableVisitor).Finally(0x140001c3180)
	/Users/amanakin/projects/protolint/linter/visitor/extendedAutoDisableVisitor.go:37 +0x54
github.com/yoheimuta/protolint/linter/visitor.extendedDisableRuleVisitor.Finally(...)
	/Users/amanakin/projects/protolint/linter/visitor/extendedDisableRuleVisitor.go:28
github.com/yoheimuta/protolint/linter/visitor.RunVisitorAutoDisable({0x1048ad3a8?, 0x1400029cf60?}, 0x1400029cf00, {0x104652be8, 0x6}, 0x5?)
	/Users/amanakin/projects/protolint/linter/visitor/hasExtendedVisitor.go:56 +0x110
github.com/yoheimuta/protolint/linter/visitor.RunVisitor(...)
	/Users/amanakin/projects/protolint/linter/visitor/hasExtendedVisitor.go:28
github.com/yoheimuta/protolint/internal/addon/rules.IndentRule.Apply({{{0x104651ae0, 0x5}}, {0x1046509ae, 0x2}, 0x0, 0x1}, 0x1400029cf00)
	/Users/amanakin/projects/protolint/internal/addon/rules/indentRule.go:80 +0x110
github.com/yoheimuta/protolint/internal/linter.(*Linter).Run(0x0?, 0x1400026da70, {0x140002a4c00?, 0x0?, 0x0?})
	/Users/amanakin/projects/protolint/internal/linter/linter.go:33 +0xf8
github.com/yoheimuta/protolint/internal/cmd/subcmds/lint.(*CmdLint).runOneFile(0x1400028e388, {{0x140001a6c80, 0x39}, {0x140001d8620, 0x1c}})
	/Users/amanakin/projects/protolint/internal/cmd/subcmds/lint/cmdLint.go:131 +0x108
github.com/yoheimuta/protolint/internal/cmd/subcmds/lint.(*CmdLint).run(0x1400028e388)
	/Users/amanakin/projects/protolint/internal/cmd/subcmds/lint/cmdLint.go:100 +0xcc
github.com/yoheimuta/protolint/internal/cmd/subcmds/lint.(*CmdLint).Run(0x1400028e388)
	/Users/amanakin/projects/protolint/internal/cmd/subcmds/lint/cmdLint.go:77 +0x44
github.com/yoheimuta/protolint/internal/cmd.doLint({0x1400019a280?, 0x140000021c0?, 0x1400006e678?}, {0x10489ed08, 0x14000196048}, {0x10489ed08, 0x14000196050})
	/Users/amanakin/projects/protolint/internal/cmd/cmd.go:110 +0x1f8
github.com/yoheimuta/protolint/internal/cmd.doSub({0x1400019a280?, 0x200000003?, 0x1400026ded8?}, {0x10489ed08?, 0x14000196048?}, {0x10489ed08?, 0x14000196050?})
	/Users/amanakin/projects/protolint/internal/cmd/cmd.go:70 +0x188
github.com/yoheimuta/protolint/internal/cmd.Do({0x1400019a280?, 0x0?, 0x10413145c?}, {0x10489ed08?, 0x14000196048?}, {0x10489ed08?, 0x14000196050?})
	/Users/amanakin/projects/protolint/internal/cmd/cmd.go:49 +0x78
main.main()
	/Users/amanakin/projects/protolint/cmd/protolint/main.go:11 +0x70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant