Skip to content

Commit 5b8b972

Browse files
committed
code formatting review
1 parent ef3a150 commit 5b8b972

File tree

19 files changed

+562
-495
lines changed

19 files changed

+562
-495
lines changed

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
distribution: temurin
2828

2929
- name: 🦞 chmod /gradlew
30-
run: chmod +x ./gradlew
30+
run: chmod +x ./gradlew
3131

3232
- name: 🔦 Test
3333
run: ./gradlew test --info

.run/TEST.run.xml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="TEST" type="JUnit" factoryName="JUnit">
3-
<module name="springdoc-openapi-gradle-plugin.test" />
4-
<shortenClasspath name="ARGS_FILE" />
5-
<useClassPathOnly />
6-
<extension name="coverage">
7-
<pattern>
8-
<option name="PATTERN" value="org.springdoc.openapi.gradle.plugin.*" />
9-
<option name="ENABLED" value="true" />
10-
</pattern>
11-
</extension>
12-
<extension name="net.ashald.envfile">
13-
<option name="IS_ENABLED" value="false" />
14-
<option name="IS_SUBST" value="false" />
15-
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
16-
<option name="IS_IGNORE_MISSING_FILES" value="false" />
17-
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
18-
<ENTRIES>
19-
<ENTRY IS_ENABLED="true" PARSER="runconfig" />
20-
</ENTRIES>
21-
</extension>
22-
<option name="ALTERNATIVE_JRE_PATH" value="corretto-19" />
23-
<option name="PACKAGE_NAME" value="org.springdoc.openapi.gradle.plugin" />
24-
<option name="MAIN_CLASS_NAME" value="org.springdoc.openapi.gradle.plugin.OpenApiGradlePluginTest" />
25-
<option name="METHOD_NAME" value="" />
26-
<option name="TEST_OBJECT" value="class" />
27-
<option name="PARAMETERS" value="" />
28-
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
29-
<method v="2">
30-
<option name="Make" enabled="true" />
31-
</method>
32-
</configuration>
2+
<configuration default="false" name="TEST" type="JUnit" factoryName="JUnit">
3+
<module name="springdoc-openapi-gradle-plugin.test"/>
4+
<shortenClasspath name="ARGS_FILE"/>
5+
<useClassPathOnly/>
6+
<extension name="coverage">
7+
<pattern>
8+
<option name="PATTERN" value="org.springdoc.openapi.gradle.plugin.*"/>
9+
<option name="ENABLED" value="true"/>
10+
</pattern>
11+
</extension>
12+
<extension name="net.ashald.envfile">
13+
<option name="IS_ENABLED" value="false"/>
14+
<option name="IS_SUBST" value="false"/>
15+
<option name="IS_PATH_MACRO_SUPPORTED" value="false"/>
16+
<option name="IS_IGNORE_MISSING_FILES" value="false"/>
17+
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false"/>
18+
<ENTRIES>
19+
<ENTRY IS_ENABLED="true" PARSER="runconfig"/>
20+
</ENTRIES>
21+
</extension>
22+
<option name="ALTERNATIVE_JRE_PATH" value="corretto-19"/>
23+
<option name="PACKAGE_NAME" value="org.springdoc.openapi.gradle.plugin"/>
24+
<option name="MAIN_CLASS_NAME"
25+
value="org.springdoc.openapi.gradle.plugin.OpenApiGradlePluginTest"/>
26+
<option name="METHOD_NAME" value=""/>
27+
<option name="TEST_OBJECT" value="class"/>
28+
<option name="PARAMETERS" value=""/>
29+
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%"/>
30+
<method v="2">
31+
<option name="Make" enabled="true"/>
32+
</method>
33+
</configuration>
3334
</component>

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [UnReleased] -
9+
810
## Added

CODE_OF_CONDUCT.adoc

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
11
= Contributor Code of Conduct
22

3-
As contributors and maintainers of this project, and in the interest of fostering an open
4-
and welcoming community, we pledge to respect all people who contribute through reporting
5-
issues, posting feature requests, updating documentation, submitting pull requests or
6-
patches, and other activities.
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
74

8-
We are committed to making participation in this project a harassment-free experience for
9-
everyone, regardless of level of experience, gender, gender identity and expression,
10-
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
11-
religion, or nationality.
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
126

137
Examples of unacceptable behavior by participants include:
148

159
* The use of sexualized language or imagery
1610
* Personal attacks
1711
* Trolling or insulting/derogatory comments
1812
* Public or private harassment
19-
* Publishing other's private information, such as physical or electronic addresses,
20-
without explicit permission
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
2114
* Other unethical or unprofessional conduct
2215
23-
Project maintainers have the right and responsibility to remove, edit, or reject comments,
24-
commits, code, wiki edits, issues, and other contributions that are not aligned to this
25-
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
26-
that they deem inappropriate, threatening, offensive, or harmful.
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
2717

28-
By adopting this Code of Conduct, project maintainers commit themselves to fairly and
29-
consistently applying these principles to every aspect of managing this project. Project
30-
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
31-
from the project team.
32-
33-
This Code of Conduct applies both within project spaces and in public spaces when an
34-
individual is representing the project or its community.
18+
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project.
19+
Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
3520

21+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
3622

3723
This Code of Conduct is adapted from the
3824
https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at

CONTRIBUTING.adoc

Lines changed: 59 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,100 @@
11
= Contributing to springdoc-openapi
22

3-
springdoc-openapi is released under the Apache 2.0 license. If you would like to contribute
4-
something, or simply want to hack on the code this document should help you get started.
5-
6-
3+
springdoc-openapi is released under the Apache 2.0 license.
4+
If you would like to contribute something, or simply want to hack on the code this document should help you get started.
75

86
== Code of Conduct
9-
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of
10-
conduct]. By participating, you are expected to uphold this code.
117

8+
This project adheres to the Contributor Covenant link:CODE_OF_CONDUCT.adoc[code of
9+
conduct].
10+
By participating, you are expected to uphold this code.
1211

1312
== Using GitHub Issues
14-
We use GitHub issues to track bugs and enhancements. If you have a general usage question
15-
please ask on https://stackoverflow.com[Stack Overflow]. The springdoc-openapi team and the
16-
broader community monitor the https://stackoverflow.com/tags/springdoc[`springdoc`]
13+
14+
We use GitHub issues to track bugs and enhancements.
15+
If you have a general usage question please ask on https://stackoverflow.com[Stack Overflow].
16+
The springdoc-openapi team and the broader community monitor the https://stackoverflow.com/tags/springdoc[`springdoc`]
1717
tag.
1818

19-
These are some basic guidelines before opening an issue. First of all you need to make sure, you don't create duplicate issues, and there no question already answred on https://stackoverflow.com/tags/springdoc.
19+
These are some basic guidelines before opening an issue.
20+
First of all you need to make sure, you don't create duplicate issues, and there no question already answred on https://stackoverflow.com/tags/springdoc.
2021

2122
If you are starting using springdoc-openapi, we advise you to use the last available release.
2223

2324
Then refer to the relevant documentation:
2425

2526
1. For OpenAPI specification 3:
26-
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
27+
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
2728
2. For swagger2-annotations:
28-
- https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations
29+
- https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations
2930
3. For swagger-ui configuration:
30-
- https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md
31+
- https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md
3132
4. For springdoc-openapi:
32-
- https://springdoc.github.io/springdoc-openapi-demos/
33-
- https://springdoc.github.io/springdoc-openapi-demos/faq.html
34-
- https://springdoc.github.io/springdoc-openapi-demos/migrating-from-springfox.html
35-
33+
- https://springdoc.github.io/springdoc-openapi-demos/
34+
- https://springdoc.github.io/springdoc-openapi-demos/faq.html
35+
- https://springdoc.github.io/springdoc-openapi-demos/migrating-from-springfox.html
3636

37-
If you are reporting a bug, please help to speed up problem diagnosis by providing as
38-
much information as possible:
3937

40-
- You need to describe your context (the title of an issue is not enough)
41-
- What version of spring-boot you are using?
42-
- What modules and versions of springdoc-openapi are you using?
43-
- What are the actual and the expected result using OpenAPI Description (yml or json)?
44-
- Provide with a sample code (HelloController) or Test that reproduces the problem
38+
If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible:
4539

40+
- You need to describe your context (the title of an issue is not enough)
41+
- What version of spring-boot you are using?
42+
- What modules and versions of springdoc-openapi are you using?
43+
- What are the actual and the expected result using OpenAPI Description (yml or json)?
44+
- Provide with a sample code (HelloController) or Test that reproduces the problem
4645

4746
== Reporting Security Vulnerabilities
48-
If you think you have found a security vulnerability in Spring Boot please *DO NOT*
49-
disclose it publicly until we've had a chance to fix it. Please don't report security
50-
vulnerabilities using GitHub issues, instead head over to support@springdoc.org and
51-
learn how to disclose them responsibly.
5247

48+
If you think you have found a security vulnerability in Spring Boot please *DO NOT*
49+
disclose it publicly until we've had a chance to fix it.
50+
Please don't report security vulnerabilities using GitHub issues, instead head over to support@springdoc.org and learn how to disclose them responsibly.
5351

5452
== Code Conventions and Housekeeping
55-
None of these is essential for a pull request, but they will all help. They can also be
56-
added after the original pull request but before a merge.
57-
58-
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project
59-
to apply code formatting conventions. If you use Eclipse and you follow the '`Importing
60-
into eclipse`' instructions below you should get project specific formatting
61-
automatically. You can also install the
62-
https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ
63-
Plugin]
53+
54+
None of these is essential for a pull request, but they will all help.
55+
They can also be added after the original pull request but before a merge.
56+
57+
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project to apply code formatting conventions.
58+
If you use Eclipse and you follow the '`Importing into eclipse`' instructions below you should get project specific formatting automatically.
59+
You can also install the
60+
https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ
61+
Plugin]
6462
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
65-
`@author` tag identifying you, and preferably at least a paragraph on what the class is
66-
for.
67-
* Add the ASF license header comment to all new `.java` files (copy from existing files
68-
in the project)
69-
* Add yourself as an `@author` to the `.java` files that you modify substantially (more
70-
than cosmetic changes).
63+
`@author` tag identifying you, and preferably at least a paragraph on what the class is for.
64+
* Add the ASF license header comment to all new `.java` files (copy from existing files in the project)
65+
* Add yourself as an `@author` to the `.java` files that you modify substantially (more than cosmetic changes).
7166
* Add some Javadocs.
7267
* A few unit tests would help a lot as well -- someone has to do it.
73-
* If no-one else is using your branch, please rebase it against the current master (or
74-
other target branch in the main project).
75-
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
76-
if you are fixing an existing issue please add `Fixes #XXXX` at the end of the commit
77-
message (where `XXXX` is the issue number).
78-
79-
68+
* If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
69+
* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions], if you are fixing an existing issue please add `Fixes #XXXX` at the end of the commit message (where `XXXX` is the issue number).
8070

8171
== Working with the Code
72+
8273
If you don't have an IDE preference we would recommend that you use IntellIJ.
8374

8475
=== Importing into IntelliJ IDEA
85-
If you have performed a checkout of this repository already, use "`File`" -> "`Open`" and
86-
then select the root `build.gradle` file to import the code.
8776

88-
Alternatively, you can let IntellIJ IDEA checkout the code for you. Use "`File`" ->
89-
"`New`" -> "`Project from Version Control`" and
90-
`https://github.com/spring-projects/spring-boot` for the URL. Once the checkout has
91-
completed, a pop-up will suggest to open the project.
77+
If you have performed a checkout of this repository already, use "`File`" -> "`Open`" and then select the root `build.gradle` file to import the code.
9278

79+
Alternatively, you can let IntellIJ IDEA checkout the code for you.
80+
Use "`File`" ->
81+
"`New`" -> "`Project from Version Control`" and
82+
`https://github.com/spring-projects/spring-boot` for the URL.
83+
Once the checkout has completed, a pop-up will suggest to open the project.
9384

9485
==== Install the Spring Formatter plugin
95-
If you haven't done so, install the formatter plugin so that proper formatting rules are
96-
applied automatically when you reformat code in the IDE.
86+
87+
If you haven't done so, install the formatter plugin so that proper formatting rules are applied automatically when you reformat code in the IDE.
9788

9889
* Download the latest https://search.maven.org/search?q=g:io.spring.javaformat%20AND%20a:spring-javaformat-intellij-plugin[IntelliJ IDEA plugin].
9990
* Select "`IntelliJ IDEA`" -> "`Preferences`".
10091
* Select "`Plugins`".
10192
* Select the wheel and "`Install Plugin from Disk...`".
10293
* Select the jar file you've downloaded.
10394

104-
10595
==== Import additional code style
106-
The formatter does not cover all rules (such as order of imports) and an additional file
107-
needs to be added.
96+
97+
The formatter does not cover all rules (such as order of imports) and an additional file needs to be added.
10898

10999
* Select "`IntelliJ IDEA`" -> "`Preferences`".
110100
* Select "`Editor`" -> "`Code Style`".
@@ -115,18 +105,18 @@ needs to be added.
115105

116106
You can use Spring Boot project specific source formatting settings.
117107

118-
119108
===== Install the Spring Formatter plugin
109+
120110
* Select "`Help`" -> "`Install New Software`".
121111
* Add `https://repo.spring.io/javaformat-eclipse-update-site/` as a site.
122112
* Install "Spring Java Format".
123113

124-
NOTE: The plugin is optional. Projects can be imported without the plugins, your code
125-
changes just won't be automatically formatted.
114+
NOTE: The plugin is optional.
115+
Projects can be imported without the plugins, your code changes just won't be automatically formatted.
126116

127117
=== Building from Source
128-
springdoc-openapi source can be built from the command line using https://maven.apache.org/[Maven] on
129-
JDK 1.8 or above.
118+
119+
springdoc-openapi source can be built from the command line using https://maven.apache.org/[Maven] on JDK 1.8 or above.
130120

131121
The project can be built from the root directory using the standard maven command:
132122

@@ -135,10 +125,10 @@ The project can be built from the root directory using the standard maven comman
135125
$ ./mvn install
136126
----
137127

138-
139128
== Cloning the git repository on Windows
140-
Some files in the git repository may exceed the Windows maximum file path (260
141-
characters), depending on where you clone the repository. If you get `Filename too long`
129+
130+
Some files in the git repository may exceed the Windows maximum file path (260 characters), depending on where you clone the repository.
131+
If you get `Filename too long`
142132
errors, set the `core.longPaths=true` git option:
143133

144134
```

0 commit comments

Comments
 (0)