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

Tool crashes when parsing Intellij Idea templates #162

Open
sruehl opened this issue Sep 4, 2024 · 3 comments
Open

Tool crashes when parsing Intellij Idea templates #162

sruehl opened this issue Sep 4, 2024 · 3 comments

Comments

@sruehl
Copy link
Contributor

sruehl commented Sep 4, 2024

when running goimports-reviser ./...

I get

Failed to fix directory ./...: failed to walk dif: failed to fix: 18:5: expected 'package', found 'EOF'

when running in projects containing Intellij Idea templates.

Is there an option to not crash the program and just ignore that directory? Seems a bit tedious to workaround that...

@sruehl
Copy link
Contributor Author

sruehl commented Sep 4, 2024

code point for reference

return fmt.Errorf("failed to fix: %w", err)

@sruehl
Copy link
Contributor Author

sruehl commented Sep 4, 2024

would be good to at least output the path in the error message to, otherwise the error looks a bit silly as can be seen above (edit: fixed with #163 )

@sruehl
Copy link
Contributor Author

sruehl commented Sep 9, 2024

ok guess the title is wrong, it actually crashes because of the idea template (with the help of #163):
.idea/fileTemplates/includes/File Header Go.go.
So I was able to fix this by -excludes .idea.

So I wonder if it might be an option to add a eager option or something which just continues on those cases or another option is to provide sensible defaults for excludes like .idea or .git because I'm quite positive that you never want to format stuff in those directories.

@sruehl sruehl changed the title Tool crashes when project contains non go code directories Tool crashes when parsing Intellij Idea templates Sep 9, 2024
sruehl added a commit to apache/plc4x that referenced this issue Sep 9, 2024
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