Skip to content

Use spotless to enforce format of en yaml files#781

Merged
kingthorin merged 1 commit intodatafaker-net:mainfrom
kingthorin:yaml-spotless
Apr 25, 2023
Merged

Use spotless to enforce format of en yaml files#781
kingthorin merged 1 commit intodatafaker-net:mainfrom
kingthorin:yaml-spotless

Conversation

@kingthorin
Copy link
Collaborator

@kingthorin kingthorin commented Apr 19, 2023

  • pom.xml
    • Update spotless plugin to 2.36.0
    • Add configuration for spotless to apply to en yaml files
    • I couldn't get other locales to behave nicely, they might have to be manually re-formatted initially. I'll investigate further for a future PR.
    • Can be applied via spotless:apply
  • en/*.yml > Reformatted using the new config.

This ensures consistency in quote usage and indents.

@codecov-commenter
Copy link

codecov-commenter commented Apr 19, 2023

Codecov Report

Merging #781 (15b8f61) into main (03a76c8) will decrease coverage by 0.06%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main     #781      +/-   ##
============================================
- Coverage     92.86%   92.81%   -0.06%     
+ Complexity     2635     2633       -2     
============================================
  Files           284      284              
  Lines          5203     5203              
  Branches        537      537              
============================================
- Hits           4832     4829       -3     
- Misses          244      245       +1     
- Partials        127      129       +2     

see 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bodiam
Copy link
Contributor

bodiam commented Apr 19, 2023

Nice work. I had a quick look, but would it be possible to remove those \ linebreaks? It seems some 80 character limit on lines got introduced, which is something from 50 years ago, and I'm not really a fan of that. Also it will make things a bit harder to keep in sync with Rubyfaker.

@kingthorin
Copy link
Collaborator Author

I’ll see what I can do.

@kingthorin
Copy link
Collaborator Author

kingthorin commented Apr 19, 2023

Some notes for myself 😀

For <yamlFeatures> should be able to set SPLIT_LINES to false
https://www.javadoc.io/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/latest/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.Feature.html#SPLIT_LINES

back_to_the_future.yml seems to be one of the "first" files alphabetically that this will impact.

@kingthorin
Copy link
Collaborator Author

Hopefully that addresses your request.

@kingthorin
Copy link
Collaborator Author

Ping @bodiam 😀

@kingthorin
Copy link
Collaborator Author

I know I can merge my own stuff, and this is now conflicting. Could someone else at least give me a comment here? 🙂

(Yes I’ll fix the conflict, just wondering if there’s other stuff I should also be tackling.)

@bodiam
Copy link
Contributor

bodiam commented Apr 25, 2023

Ah, sorry! I'm fine with it, go ahead!!

@kingthorin
Copy link
Collaborator Author

Thanks, I’ll get it tiddied up tomorrow 😄

@kingthorin kingthorin force-pushed the yaml-spotless branch 2 times, most recently from 79f6775 to a39eb9e Compare April 25, 2023 10:39
- pom.xml
    - Update spotless plugin to 2.36.0
    - Add configuration for spotless to apply to en yaml files
    - I couldn't get other locales to behave nicely, they might have to
be manually re-formatted initially. I'll investigate further for a
future PR.
    - Can be applied via `spotless:apply`
- en/*.yml > Reformatted using the new config.

This ensures consistency in quote usage and indents.

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@kingthorin
Copy link
Collaborator Author

Conflict addressed, and new files formatted.

@kingthorin kingthorin merged commit 68679eb into datafaker-net:main Apr 25, 2023
@kingthorin kingthorin deleted the yaml-spotless branch April 25, 2023 10:54
@bodiam
Copy link
Contributor

bodiam commented Apr 25, 2023

Nice one, thanks!

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.

3 participants