diffplug / diffplug/spotless

Enabling Parrot Parser for Groovy Eclipse

Đang mở
#975 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Java
Star
5.6k
Fork
559
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
43

Mô tả

Since spotless depends on groovy-eclipse for groovy parsing/formatting, and since groovy-eclipse doesn't enable the parrot parser by default, Spotless fails when configured for groovy code that utilizes Groovy 3+ syntax.

After experiencing some pain with spotless + groovy, I stumbled upon #246 which led me to dig into groovy-eclipse. Turns out groovy-eclipse leaves the new antlr4 based Parrot Parser [disabled by default](https://github.com/groovy/groovy-eclipse/wiki/4.2.0-Release-Notes#support-for-new-versions-of-groovy), which means any newer Groovy 3 syntax that contains, for example, Java lambdas, blows up.

I can manually add `-Dgroovy.antlr4=true` to my Gradle execution and that gets it working for me locally, but there should be some way to configure this right within build.gradle? I'm trying to find a solution that is more amenable to a team environment.

In the past I've modified JavaExec tasks and the like to include forked JVM options. But there seems to be no way to do that for SpotlessTask.

Am I missing something obvious here?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách lần theo SpotlessTask và cấu hình Gradle được mô tả trong build.gradle, sau đó tái hiện lỗi với cú pháp Groovy 3+ và tùy chọn -Dgroovy.antlr4=true. Công việc được xem là hoàn tất khi một nhóm có thể bật Parrot Parser thông qua build.gradle mà không cần thêm thủ công một tùy chọn JVM vào mỗi lần thực thi Gradle.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
groovy, java
Lĩnh vực
build-system, tooling
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.