serpro69 / kotlin-faker

Port of a popular ruby faker gem written in kotlin. Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.
https://serpro69.github.io/kotlin-faker/
MIT License
472 stars 44 forks source link

Cannot generate valid en-GB postcode #187

Closed cosmin-marginean closed 1 year ago

cosmin-marginean commented 1 year ago

When generating a UK (en-GB) postcode, a pattern is returned instead of a postcode.

val faker = Faker(fakerConfig { locale = "en-GB" })
println(faker.address.postcode())

This generates:

/[A-PR-UWYZ]([A-HK-Y][0-9][ABEHMNPRVWXY0-9]?|[0-9][ABCDEFGHJKPSTUW0-9]?) [0-9][ABD-HJLNP-UW-Z]{2}/

The used kotlin-faker version is 1.14.0.

cosmin-marginean commented 1 year ago

I have a PR for what seems to be the fix here, along with the test, but I'm not confident about it so if you don't mind checking it that'd be great: https://github.com/serpro69/kotlin-faker/pull/188

serpro69 commented 1 year ago

Hi @cosmin-marginean , Thanks a lot for opening this issue and submitting a PR with a fix :) I'll go over the PR in a bit 👍

cosmin-marginean commented 1 year ago

Thanks for the quick turnaround!

cosmin-marginean commented 1 year ago

PS> Let us know when we can get a snapshot to include this fix (or if there's an ETA for the next release) - I'll try to build it locally in the interim.

serpro69 commented 1 year ago

Snapshots are built and published on each commit to master, so if you're ok with using a snapshot - it should already be available ;)

Otherwise let me know if snapshots aren't good for your project and I will make a release candidate version within this week.

cosmin-marginean commented 1 year ago

Ah, that's good to know, I wasn't aware of that! Will go with snapshot for now. Many thanks again!

serpro69 commented 1 year ago

Ah, that's good to know, I wasn't aware of that! Will go with snapshot for now. Many thanks again!

no worries :) here's the doc page that mentions how to get the snapshot version https://serpro69.github.io/kotlin-faker/wiki/getting-started/#snapshots