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

Use array of chars instead of StringBuilder for Company#domainName #978

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

snuyanzin
Copy link
Collaborator

No description provided.

@what-the-diff
Copy link

what-the-diff bot commented Oct 2, 2023

PR Summary

  • Modification to url() method in Company.java
    The way website URLs are created in our system has been updated. Previously, the domain name and suffix were joined together in a specific way that we found could be improved. Now, these two parts are simply combined with a "." in between, resulting in cleaner, more reliable URLs.

  • Update to domainName() method in Company.java
    We've also improved how we generate domain names. Previously, a company's domain name could include special characters, which sometimes caused issues. With this update, we'll remove any special characters from the company name before we use it for the domain. This should create more stable and predictable domain names.

  • Patterns added in CompanyTest.java
    Finally, we've made updates to our system tests. We added two new patterns to check the format of URLs and 'catchphrases' (unique company slogans) in our system. This ensures that the changes we made to the URL and domain name generation are functioning correctly, and that the structure of our 'catchphrases' remains consistent.

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2023

Codecov Report

Merging #978 (af40c96) into main (d7ade4f) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@             Coverage Diff              @@
##               main     #978      +/-   ##
============================================
- Coverage     92.39%   92.33%   -0.06%     
+ Complexity     2761     2760       -1     
============================================
  Files           289      289              
  Lines          5522     5522              
  Branches        601      601              
============================================
- Hits           5102     5099       -3     
- Misses          268      270       +2     
- Partials        152      153       +1     
Files Coverage Δ
...ain/java/net/datafaker/providers/base/Company.java 97.61% <100.00%> (ø)

... and 3 files with indirect coverage changes

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


class CompanyTest extends BaseFakerTest<BaseFaker> {

public static final Pattern URL_PATTERN = Pattern.compile("(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this is just a copy/paste but could you make it consistent in lower then caps for the letter sets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, that makes sense thanks

Copy link
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

Thanks

@kingthorin kingthorin merged commit 6ab8ca0 into datafaker-net:main Oct 2, 2023
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