Skip to content

feat: add MartialArt provider with names#1549

Merged
kingthorin merged 3 commits intodatafaker-net:mainfrom
paulofranklins2:main
May 8, 2025
Merged

feat: add MartialArt provider with names#1549
kingthorin merged 3 commits intodatafaker-net:mainfrom
paulofranklins2:main

Conversation

@paulofranklins2
Copy link
Copy Markdown
Contributor

@paulofranklins2 paulofranklins2 commented May 7, 2025

  • Created MartialArt provider in net.datafaker.providers.sport
  • Added martialart() accessor in SportProviders interface
  • Registered YAML resource file martial_art.yml with martial art names
  • Updated EnFile to include "martial_art.yml"
  • Implemented unit tests in MartialArtTest for name

- Created MartialArt provider in `net.datafaker.providers.sport`
- Added `martialart()` accessor in SportProviders interface
- Registered YAML resource file `martial_art.yml` with martial art names and origins
- Updated EnFile to include "martial_art.yml"
- Implemented unit tests in `MartialArtTest` for name and origin resolution
@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented May 7, 2025

PR Summary

  • Created a New Category: Martial Art
    A new code component, MartialArt, has been added. This allows the system to have information about different martial arts.

  • Provided Details for Martial Art
    Two pieces of information, name and origin, about martial arts can now be obtained directly from the system using the new methods implemented in the MartialArt component.

  • Enable Access to Martial Art Information
    Modified the system's Sport Providers (a place where you can obtain sports information) to include martial arts. Using the new method martialart(), you can now retrieve related information.

  • Added Martial Art Support in English
    The English language file has been updated to accommodate martial arts related terms. A new file, martial_art.yml, has been included for this purpose.

  • Inclusion of Martial Art Information
    A file containing extensive list of martial arts names and their origins known as martial_art.yml has been added to the system.

  • Tested the New Addition
    A new test, MartialArtTest, has been created to ensure the MartialArt component works as intended.

@kingthorin
Copy link
Copy Markdown
Collaborator

To address the build failure:
01:54:10.734 [ERROR] Run 'mvn spotless:apply' to fix these violations.

@asolntsev asolntsev added this to the 2.4.4 milestone May 7, 2025
* <p>Contributed by Paulo Cunha</p>
*
* @see <a href="https://github.com/paulofranklins2/">https://github.com/paulofranklins2/</a>
* @see <a href="https://www.linkedin.com/in/paulofranklins2/">https://www.linkedin.com/in/paulofranklins2/</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thank you good catch.

return getProvider(Volleyball.class, Volleyball::new);
}

default MartialArt martialart() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'd like to have the methods here alphabetically sorted please.

Copy link
Copy Markdown
Collaborator

@asolntsev asolntsev May 7, 2025

Choose a reason for hiding this comment

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

Shouldn't we use camelCase in method name?

I mean, "martialart " -> "martialArt".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorted.

Renamed, good catch.

- "Kajukenbo"
- "Shootfighting"
- "LINE"
origin:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we really need an origin, it's hardly different than the Country.name() right? For example, there's also Dutch kickboxing, which could work well with Country.name().

Note: I don't have too many concerns about having this list here, I'm just thinking out loud a little.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed.

refactor: correct method name for martialArt provider

Fix: update contributor link

- Fixed duplicate and incorrectly named `martialart()` method in `SportProviders.java`.
- Updated contributor LinkedIn link in `MartialArt.java` Javadoc.

refactor: remove unused origin() method from MartialArt provider

- Removed origin() method from MartialArt.java as it was not needed
- Updated class Javadoc to reflect single method purpose
@kingthorin
Copy link
Copy Markdown
Collaborator

Still needs the aforementioned spotless apply

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.40%. Comparing base (3ca30f2) to head (8dfb893).
⚠️ Report is 281 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1549      +/-   ##
============================================
+ Coverage     92.36%   92.40%   +0.03%     
- Complexity     3285     3289       +4     
============================================
  Files           326      327       +1     
  Lines          6474     6478       +4     
  Branches        630      630              
============================================
+ Hits           5980     5986       +6     
+ Misses          339      338       -1     
+ Partials        155      154       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kingthorin kingthorin changed the title feat: add MartialArt provider with name and origin support feat: add MartialArt provider with names May 8, 2025
@kingthorin kingthorin merged commit fc64cf1 into datafaker-net:main May 8, 2025
13 checks passed
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.

5 participants