-
Notifications
You must be signed in to change notification settings - Fork 114
Improve formatting to wrap enum constants where necessary #313
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
Comments
We delegate to the Eclipse formatter so I'm not sure there's much we can do about this ourselves. Perhaps there's an setting that we've missed that will ensure each enum is on a new line. @cbot59 I have you tried formatting the code directly in Eclipse without our formatter? I'd be interested to know if it has the same problem. For our own code, we usually have javadoc on each enum element so haven't noticed the issue. |
I tried this and forgot to comment on the issue. Sorry. Formatted with Eclipse's default formatter, the code looks like this: package com.example.demo;
public enum AdditionalRemarks {
EMPTY("", "", ""),
REMARKS_07_01("Kawasan Bebas", "PAJAK PERTAMBAHAN NILAI TIDAK DIPUNGUT BERDASARKAN PP NOMOR 10 TAHUN 2012", "1"),
REMARKS_07_02("Tempat Penimbunan Berikat",
"Pajak Pertambahan Nilai atau Pajak Pertambahan Nilai dan Pajak Penjualan atas Barang Mewah tidak dipungut",
"2"),
REMARKS_07_03("Hibah dan Bantuan Luar Negeri",
"PAJAK PERTAMBAHAN NILAI DAN PAJAK PENJUALAN ATAS BARANG MEWAH TIDAK DIPUNGUT", "3"),
REMARKS_07_04("Avtur", "PAJAK PERTAMBAHAN NILAI TIDAK DIPUNGUT SESUAI PP NOMOR 71 TAHUN 2012", "4"),
REMARKS_07_06("Kontraktor Perjanjian Karya Pengusahaan Pertambangan Batubara Generasi I",
"PPN dan/atau PPnBM tidak dipungut berdasarkan PMK No.194/PMK.03/2012", "6"),
REMARKS_07_07("Penyerahan bahan bakar minyak untuk Kapal Angkutan Laut Luar Negeri",
"PPN TIDAK DIPUNGUT BERDASARKAN PP NOMOR 15 TAHUN 2015", "7"),
REMARKS_07_08("Penyerahan jasa kena pajak terkait alat angkutan tertentu",
"PPN TIDAK DIPUNGUT BERDASARKAN PP NOMOR 69 TAHUN 2015", "8"),
REMARKS_07_09("Penyerahan BKP Tertentu di KEK", "PPN TIDAK DIPUNGUT BERDASARKAN PP NOMOR 96 TAHUN 2015", "9"),
REMARKS_07_10("BKP tertentu yang bersifat strategis berupa anode slime",
"PPN TIDAK DIPUNGUT BERDASARKAN PP NOMOR 106 TAHUN 2015", "10"),
REMARKS_07_05("Lainnya", "", "5"),
REMARKS_08_01("BKP dan JKP Tertentu",
"PPN DIBEBASKAN SESUAI PP NOMOR 146 TAHUN 2000 SEBAGAIMANA TELAH DIUBAH DENGAN PP NOMOR 38 TAHUN 2003",
"1"),
REMARKS_08_02("BKP Tertentu yang Bersifat Strategis sesuai PP NOMOR 12 TAHUN 2001",
"PPN DIBEBASKAN SESUAI PP NOMOR 12 TAHUN 2001 SEBAGAIMANA TELAH BEBERAPA KALI DIUBAH TERAKHIR DENGAN PP NOMOR 31 TAHUN 2007",
"2"),
REMARKS_08_03("Jasa Kebandarudaraan", "PPN dibebaskan berdasarkan Peraturan Pemerintah Nomor 28 Tahun 2009", "3"),
REMARKS_08_05("BKP Tertentu yang Bersifat Strategis sesuai PP NOMOR 81 TAHUN 2015",
"PPN DIBEBASKAN SESUAI DENGAN PP NOMOR 81 TAHUN 2015", "5"),
REMARKS_08_06("Penyerahan Jasa Kepelabuhan Tertentu untuk kegiatan angkutan laut Luar Negeri",
"PPN DIBEBASKAN BERDASARKAN PP NOMOR 74 TAHUN 2015", "6"),
REMARKS_08_04("Lainnya", "", "4"),
REMARKS_07_11("Penyerahan alat angkutan tertentu dan/atau Jasa Kena Pajak terkait alat angkutan tertentu",
"PPN TIDAK DIPUNGUT SESUAI PP NOMOR 50 TAHUN 2019", "11"),
REMARKS_07_12(
"Penyerahan kepada Kontraktor Kerja Sama Migas yang mengikuti ketentuan Peraturan Pemerintah Nomor 27 Tahun 2017",
"PPN ATAU PPN DAN PPnBM TIDAK DIPUNGUT SESUAI DENGAN PP NOMOR 27 TAHUN 2017", "12"),
REMARKS_07_13("Penyerahan Rumah Tapak dan Unit Hunian Rumah Susun yang Ditanggung Pemerintah Tahun Anggaran 2021",
"PPN DITANGGUNG PEMERINTAH EKS PMK 21/PMK.010/2021", "13"),
REMARKS_08_07("Penyerahan Air Bersih", "", "7"),
REMARKS_07_14(
"Penyerahan Jasa Sewa Ruangan atau Bangunan Kepada Pedagang Eceran yang Ditanggung Pemerintah Tahun Anggaran 2021",
"PPN DITANGGUNG PEMERINTAH EKS PMK 102/PMK.010/2021", "14"),
REMARKS_07_15("Penyerahan Barang dan Jasa Dalam Rangka Penanganan Pandemi COVID-19 (PMK 239/PMK. 03/2020)",
"PPN DITANGGUNG PEMERINTAH EKS PMK 239/PMK.03/2020", "15"),
REMARKS_07_16(
"Insentif PMK-103/PMK.010/2021 berupa PPN atas Penyerahan Rumah Tapak dan Unit Hunian Rumah Susun yang Ditanggung Pemerintah Tahun Anggaran 2021 ",
"PPN DITANGGUNG PEMERINTAH EKSEKUSI PMK NOMOR 103/PMK.010/2021", "16");
private final String description;
private final String contentStamp;
private final String value;
private AdditionalRemarks(String description, String contentStamp, String value) {
this.description = description;
this.contentStamp = contentStamp;
this.value = value;
}
} So it looks like Java Format is responsible somehow. |
The problem appears to be Line 117 in 4f550f7
It's set to 16 by default in Eclipse. 16 equates to "Wrap where necessary". 0 is "Do not wrap". |
I'm having an unreadable format (from my pov at least) on an enum file that I was wrote. I'm unsure whether this is an expected case or something should be improved. Here is the diff i got

Here is the original code
The text was updated successfully, but these errors were encountered: