jhipster-core icon indicating copy to clipboard operation
jhipster-core copied to clipboard

Remove terminal commas

Open MathieuAA opened this issue 4 years ago • 12 comments

This issue comes from a discussion between @colameo and I about terminal commas. This issue's goal is to define the necessary rules to make terminal commas obsolete in the future, and/or at least make them optional in all the relevant cases first.

Any opinion is welcome

@colameo if the description doesn't convey your meaning please do rephrase it.

MathieuAA avatar Apr 27 '20 11:04 MathieuAA

IMO all classifier elements of type:

<classifier> <name> {
    elements = element (',' element)*
}

should be without commas ,

there is really no benefit of having a separator and because it's optional it makes even harder to parse because weird definitions like the followings are allowed and also valid:

entity Department {
  guid UUID required,
  name String required unique
  description TextBlob,
  advertisement Blob
  logo ImageBlob
}

colameo avatar Apr 28 '20 06:04 colameo

If we remove the commas completely, it would be a breaking change (and not a small one). Making them optional first and printing warnings about them should be a good start. Maybe the linter can help for this (I really have to dig it up).

As a side note, if we remove commas out of the equation, this leaves the newline as a separator. Not so sure about this one.

MathieuAA avatar Apr 28 '20 08:04 MathieuAA

could we at least remove commas from application and deployment config sections? that would simplify the handling of options a lot ... (at least for the current refactoring work I'm doing).

colameo avatar May 02 '20 12:05 colameo

Yes, and relationships too. I'm merging JCore and the generator and this is taking me some time. I'll get to it right after

MathieuAA avatar May 02 '20 13:05 MathieuAA

@colameo I'll be working on it today

MathieuAA avatar May 12 '20 07:05 MathieuAA

Okay, the only case where commas aren't optional is with the enum, I'm making them optional.

MathieuAA avatar May 12 '20 07:05 MathieuAA

The next step would be to update the linter and make the JDL importer use it

MathieuAA avatar May 12 '20 07:05 MathieuAA

Hi, I came here from issue #347, even ```export-jdl`` command should export a JDL without commas. I'm writing it here just as reminder :-)

funder7 avatar Jun 15 '20 21:06 funder7

Hello, don't worry it's not forgotten ;) just don't have time to do it...

MathieuAA avatar Jun 16 '20 07:06 MathieuAA

Okay! :-D

funder7 avatar Jun 16 '20 15:06 funder7

You know what? I'll do this this weekend. Thanks :)

MathieuAA avatar Jun 16 '20 18:06 MathieuAA

Yeah!! Let's do it! :-D

funder7 avatar Jun 18 '20 18:06 funder7