Andreas Svanberg
1554d4bc27
All checks were successful
Build and test / build-and-test (push) Successful in 11m55s
Fixes #43 by introducing [Prettier](https://prettier.io/). Prettier is an extremely opinionated formatter. It will reformat every single line according to its style. There are virtually no configuration options so there can be no discussion about formatting rules. There are two parameters that are configurable; indent length and line length. Indent length has been set to 4 because that's the Java standard. Line length defaults to 80 but has been increased to 100. The rational for this is that Prettier was created for JavaScript which is much less verbose than Java. Not only does every Java line start with 8 spaces of indentation vs. JavaScripts 0 or 2, it also has types wile JavaScript does not and uses `const` for variable declarations. Compare the two below examples as well as an actual example from the source code that is too long for the default 80 characters. I have no problem dropping down to the default 80 if that is preferred I just felt that with the average length of a line of Java code being pretty long, excessive wrapping would reduce readability. ```javascript const attributes = { ... }; ``` ```java Map<String, String> attributes = Map.of( ... ); ``` Or the following real code which is 97 characters long. ```java Set<ProjectParticipant> contributors = daisyAPI.getContributors(project.getIdentifier()); ``` Reviewed-on: #44 Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se> Co-authored-by: Andreas Svanberg <andreass@dsv.su.se> Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
139 lines
5.1 KiB
JSON
139 lines
5.1 KiB
JSON
{
|
|
"name": "scipro",
|
|
"lockfileVersion": 3,
|
|
"requires": true,
|
|
"packages": {
|
|
"": {
|
|
"devDependencies": {
|
|
"prettier-plugin-java": "^2.6.5"
|
|
}
|
|
},
|
|
"node_modules/@chevrotain/cst-dts-gen": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz",
|
|
"integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"@chevrotain/gast": "11.0.3",
|
|
"@chevrotain/types": "11.0.3",
|
|
"lodash-es": "4.17.21"
|
|
}
|
|
},
|
|
"node_modules/@chevrotain/gast": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.0.3.tgz",
|
|
"integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"@chevrotain/types": "11.0.3",
|
|
"lodash-es": "4.17.21"
|
|
}
|
|
},
|
|
"node_modules/@chevrotain/regexp-to-ast": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz",
|
|
"integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==",
|
|
"dev": true,
|
|
"license": "Apache-2.0"
|
|
},
|
|
"node_modules/@chevrotain/types": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz",
|
|
"integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==",
|
|
"dev": true,
|
|
"license": "Apache-2.0"
|
|
},
|
|
"node_modules/@chevrotain/utils": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz",
|
|
"integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==",
|
|
"dev": true,
|
|
"license": "Apache-2.0"
|
|
},
|
|
"node_modules/chevrotain": {
|
|
"version": "11.0.3",
|
|
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz",
|
|
"integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"@chevrotain/cst-dts-gen": "11.0.3",
|
|
"@chevrotain/gast": "11.0.3",
|
|
"@chevrotain/regexp-to-ast": "11.0.3",
|
|
"@chevrotain/types": "11.0.3",
|
|
"@chevrotain/utils": "11.0.3",
|
|
"lodash-es": "4.17.21"
|
|
}
|
|
},
|
|
"node_modules/chevrotain-allstar": {
|
|
"version": "0.3.1",
|
|
"resolved": "https://registry.npmjs.org/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz",
|
|
"integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==",
|
|
"dev": true,
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"lodash-es": "^4.17.21"
|
|
},
|
|
"peerDependencies": {
|
|
"chevrotain": "^11.0.0"
|
|
}
|
|
},
|
|
"node_modules/java-parser": {
|
|
"version": "2.3.2",
|
|
"resolved": "https://registry.npmjs.org/java-parser/-/java-parser-2.3.2.tgz",
|
|
"integrity": "sha512-/O42UbEHy3VVJw8W0ruHkQjW75oWvQx4QisoUDRIGir6q3/IZ4JslDMPMYEqp7LU56PYJkH5uXdQiBaCXt/Opw==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"chevrotain": "11.0.3",
|
|
"chevrotain-allstar": "0.3.1",
|
|
"lodash": "4.17.21"
|
|
}
|
|
},
|
|
"node_modules/lodash": {
|
|
"version": "4.17.21",
|
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
|
"dev": true,
|
|
"license": "MIT"
|
|
},
|
|
"node_modules/lodash-es": {
|
|
"version": "4.17.21",
|
|
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
|
|
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
|
"dev": true,
|
|
"license": "MIT"
|
|
},
|
|
"node_modules/prettier": {
|
|
"version": "3.2.5",
|
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
|
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
|
"dev": true,
|
|
"license": "MIT",
|
|
"bin": {
|
|
"prettier": "bin/prettier.cjs"
|
|
},
|
|
"engines": {
|
|
"node": ">=14"
|
|
},
|
|
"funding": {
|
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
|
}
|
|
},
|
|
"node_modules/prettier-plugin-java": {
|
|
"version": "2.6.5",
|
|
"resolved": "https://registry.npmjs.org/prettier-plugin-java/-/prettier-plugin-java-2.6.5.tgz",
|
|
"integrity": "sha512-2RkPNXyYpP5dRhr04pz45n+e5LXwYWTh1JXrztiCkZTGGokIGYrfwUuGa8csnDoGbP6CDPgVm8zZSIm/9I0SRQ==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"java-parser": "2.3.2",
|
|
"lodash": "4.17.21",
|
|
"prettier": "3.2.5"
|
|
}
|
|
}
|
|
}
|
|
}
|