Skip to content
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

Limit docs code snippets line length to max 60 chars (#317 / #318) #318

Merged
merged 17 commits into from Sep 29, 2020

Conversation

Bukama
Copy link
Member

@Bukama Bukama commented Aug 8, 2020

I don't see a way to cut the examples in TempDir extension, so I leave this to maybe refactored method names in #277

Limit docs code snippets line length to max 60 chars (#317 / #318)

To avoid horizontal scroll bars inside the code examples of the
documentation pages the line length of them must not more
that 60 characters.

PR checklist

The following checklist shall help the PR's author, the reviewers and maintainers to ensure the quality of this project.
It is based on our contributors guidelines, especially the "writing code" section.
It shall help to check for completion of the listed points.
If a point does not apply to the given PR's changes, the corresponding entry can be simply marked as done.

Documentation (general)

  • There is documentation (Javadoc and site documentation; added or updated)
  • There is implementation information to describe why a non-obvious source code / solution got implemented
  • Site documentation has its own .adoc file in the docs folder, e.g. docs/report-entries.adoc
  • Only one sentence per line (especially in .adoc files)
  • Javadoc uses formal style, while sites documentation may use informal style (see Documentation: Personal or formal style #265)

Documentation (new extension)

  • The docs/docs-nav.yml navigation has an entry for the new extension
  • The package-info.java contains information about the new extension

Code

  • Code adheres to code style, naming conventions etc.
  • Successful tests cover all changes
  • There are checks which validate correct / false usage / configuration of a functionality and there are tests to verify those checks (see Require configuration failiure tests? #164)
  • Tests use AssertJ or our own PioneerAssert (which are based on AssertJ)

Contributing

  • A prepared commit message exists
  • The list of contributions inside README.md mentions the new contribution (real name optional)

I hereby agree to the terms of the JUnit Pioneer Contributor License Agreement.

Copy link
Member

@Michael1993 Michael1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

What you could do (as a bonus) is pull in Java::Geci as a dependency and auto-insert the code snippets from our tests as examples. 😉

Copy link
Member

@beatngu13 beatngu13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the hard work! But could it be that you mixed tabs and whitespaces for indentation? Example:

https://github.com/junit-pioneer/junit-pioneer/pull/318/files#diff-f66b5eb32a0e201487cfc4e81f6bdc04R17

Line 17 uses a tab, line 18 whitespaces.

@beatngu13
Copy link
Member

What you could do (as a bonus) is pull in Java::Geci as a dependency and auto-insert the code snippets from our tests as examples. 😉

Haven't heard about Java::Geci, sounds cool! But I would suggest to do that in a separate PR.

@Bukama
Copy link
Member Author

Bukama commented Sep 6, 2020

Thx for the hard work! But could it be that you mixed tabs and whitespaces for indentation? Example:

https://github.com/junit-pioneer/junit-pioneer/pull/318/files#diff-f66b5eb32a0e201487cfc4e81f6bdc04R17

Line 17 uses a tab, line 18 whitespaces.

Sometimes I don't understand IntellJ. AsciiDoc settings were set to "Use tab character" with "tab size 4" and IntelliJ printed 4 spaces... After dis- and reenabling the setting tabs are used. On the otherside: Shouldn't spotless take care of this or let the build break? Nevermind: Replaced all space with tabs.

System.out.println(d + " degrees Celsius is cold");
System.out.println(d + " degrees Fahrenheit is REALY cold");
System.out.println(d + " degrees Kelvin is too cold to be true");
System.out.println(d + " °C is cold");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, non-ASCII chars in code snippets? 😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Extended) ASCII-Code 248 :p http://www.asciitable.com/

I havn't come up with the short limit of 60 chars where about 40 are for intenden and System.out.println(..); 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every day's a school say. 👍

docs/retrying-test.adoc Outdated Show resolved Hide resolved
docs/standard-input-output.adoc Show resolved Hide resolved
docs/standard-input-output.adoc Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
@beatngu13
Copy link
Member

Shouldn't spotless take care of this or let the build break?

Not that familiar with Spotless, could it be it doesn't check Asciidoc? I will have a look and create an issue if necessary.

@Bukama
Copy link
Member Author

Bukama commented Sep 6, 2020

Shouldn't spotless take care of this or let the build break?

Not that familiar with Spotless, could it be it doesn't check Asciidoc? I will have a look and create an issue if necessary.

Maybe. At least there are only spotlessApplyJava and spotlessApplyGroovy targets in the Gradle.

Thanks for pointing the missing spaces. Don't know why IntelliJ hasn't shown them to me.

Displaying in Github is strange anyway. Some lines are aligned in IntellI, but are not in Github....

docs/system-properties.adoc Outdated Show resolved Hide resolved
docs/system-properties.adoc Outdated Show resolved Hide resolved
Format retrying-test.adoc code samples
@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nipafx nipafx merged commit ffc5506 into junit-pioneer:master Sep 29, 2020
@Bukama Bukama deleted the bishue317/docmaxchars branch September 30, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants