Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.8k stars 773 forks source link

Apply contribution guidelines #921

Closed henriquemoody closed 4 years ago

henriquemoody commented 6 years ago

TL;DR


It's been a MAJOR or MINOR version of the library has been released. There are enough things to release the version 2.0 but I need your help.

I wrote new Contribution Guidelines and before I creating the tag 2.0.0 I would like to have all rules with the same standard.

Applying the Contribution Guidelines consist of:

I've done some already but there is still a lot to go, write a comment with the rule name before you start working on it, so two people don't work on the same thing!

Hope you can help!

Rules

Some rules are not on the list, but they are not Easy Pick.

henriquemoody commented 6 years ago

I'm getting the Between

henriquemoody commented 6 years ago

I'm getting the KeySet

paulkarikari commented 6 years ago

I'm getting AllOf

DaniloBenevides commented 6 years ago

I'm getting Uppercase

nickl- commented 6 years ago

Well done! whoop whoop!!

Unfortunately I'm not quite free right now... knee deep in java, but will try and wriggle my way out before this is done.

paulkarikari commented 6 years ago

while working on AllOf , I realized it is being extended by other Rules, hence setting the class as final is not feasible. Also adding type hinting will cause a cascade of incompatible interfaces and function signatures. I suggest the following task should be tackled in one phase and the other two should be tackled in another phase with much diligence.


Next Phase

@henriquemoody @nickl- any taughts ?

henriquemoody commented 6 years ago

Some rules require more than applying the guidelines. I updated the list of Rules in the description of this issue, mentioning only the ones that are easy to work on, I'll pick up myself because of the more structural changes.

If you can pick other rule that will be simpler that would be the cool. If you have something already done already in the "AllOf" rule, you can just send it as it, and I'll pick it up from there you left! But I think we should try to apply the complete list at once, there are too many rules to do into more steps, IMO.

Thanks for your feedback, @koficodes! 🐼

paulkarikari commented 6 years ago

Well noted. will pick another rule for now. Thanks for the quick response. :+1:

williamespindola commented 6 years ago

I'm getting the Contains

paulkarikari commented 6 years ago

I'm getting Even

DaniloBenevides commented 6 years ago

Im getting Lowercase

williamespindola commented 6 years ago

Guys I found a bug on Contains rule during the work. I would send a patch but looking at the history of file this problem exists for a long time ago. I think that we can continue this work and I will join the fix with apply of this issue. What you think about that? About the problem. The Contains rule do not check if an item of array has no identical value because it checks if is array before execute the verification with no identical. This will work v:contains('foo')->check('fool') but this don't v:contains('foo')->check(['fool', 'bar'])

henriquemoody commented 6 years ago

@williamespindola while applying the contribution guidelines I've found a few bugs myself!

However, if I understood what you said correctly that's the expected behaviour.

If you're searching in a string, you need a match in the string:

v:contains('foo')->validate('fool'); // true
v:contains('foo')->validate('fol'); // false

If you're searching in an array, you need a match in the array:

v:contains('foo')->validate(['foo', 'bar'); // true
v:contains('foo')->validate(['fol', 'bar'); // false

It's inverted behaviour of "In".

henriquemoody commented 6 years ago

I'm getting IterableType

williamespindola commented 6 years ago

@henriquemoody I don't know if I get it wrong. But the Contais rule have a flag on constructor to match value identical or not. Then if we passe true it will sought for exactly foo but whether we pass false or nothing this will sought for a similar e.g. foo == fool take a look https://3v4l.org/mYGVe

williamespindola commented 6 years ago

I'm getting Countable

williamespindola commented 6 years ago

I'm getting Cpf

williamespindola commented 6 years ago

I'm getting AlwaysInvalid and AlwaysValid

williamespindola commented 6 years ago

I'm working on ArrayVal, Base64, Base, BoolType and BoolVal

DaniloBenevides commented 6 years ago

I am getting FloatVal and FloatType

IsmaelElias commented 6 years ago

i'm getting Positive

IsmaelElias commented 6 years ago

I'm getting Negative

DaniloBenevides commented 6 years ago

I am getting Odd

IsmaelElias commented 6 years ago

I'm getting PrimeNumber

paulkarikari commented 6 years ago

I'm getting email

DaniloBenevides commented 6 years ago

I'm getting NoWhitespace

nickl- commented 6 years ago

31% completed... this is taking for ever =(

Good job so far guys!

williamespindola commented 6 years ago

working on Bsn, Callback, Charset, Cnh, Cnpj

DaniloBenevides commented 6 years ago

I'm getting PerfectSquare.

williamespindola commented 6 years ago

I'm getting CountryCode, CreditCard, CurrencyCode, Directory and Each

IsmaelElias commented 6 years ago

I'm getting Number

paulkarikari commented 6 years ago

I'm getting :

henriquemoody commented 6 years ago

There is a new version of the script: https://gist.github.com/henriquemoody/d4409df72a86dd07b9a794635ce0995a

williamespindola commented 6 years ago

I'm working on: EndsWith, Executable, Exists, Extension, Factor, FalseVal, Fibonacci, File, Finite

nickl- commented 6 years ago

52% Whoop whoop!! It's all downhill from here =)

Go-go-go!!

DaniloBenevides commented 6 years ago

I'm getting intVal and Multiple

nickl- commented 6 years ago

Only 54% now, what's happening? We were doing so well!

I saw @henriquemoody agreed to release v1.1.19 is this the reason progress is impacted?

Come on guys almost there, lets get this done!

nickl- commented 6 years ago

I must've missed the memo... has this development now stopped?

henriquemoody commented 6 years ago

Not at all! I did spend quite some time on the version 1.1.19, there were quite a few bugs. In retrospect, that was a bad decision. Now I'm struggling for a few days with the merge of the branch 1.1 into master. However, it should not stop! As soon as I merge the 1.0 I'm right back into the 2.0!

How about you, @koficodes, @DaniloBenevides, and @williamespindola?

And thanks for pushing it forward, @nickl-!

williamespindola commented 6 years ago

I'll be back Just solving some issue in my work

DaniloBenevides commented 6 years ago

I'll be back too! Tomorrow i will try to back to the rhythm

DaniloBenevides commented 6 years ago

I'm getting Image and Imei

nickl- commented 6 years ago

It seems our progress is still stuck at 54% completion.

Is there any obstacles preventing this from moving forward which we could move out of the way or is this purely due to availability constraints?

How about a commitment to get 55%? @DaniloBenevides are you done with Imei and Image yet? @williamespindola has the Sky Labs mainframe authorised your return yet? =)

Lets get this wheel turning again, what do you say?

nickl- commented 6 years ago

Added tick to Multiple rule #1051 ...no progress was really getting me down =)

DaniloBenevides commented 6 years ago

I'm working on Imei Rule , will try to finish till weekend. I think i can try 5 rules per week from next monday. :smile:

nickl- commented 6 years ago

@DaniloBenevides Go get them tiger! =)

gl

DaniloBenevides commented 6 years ago

I'm getting Infinite , Instance and In

DaniloBenevides commented 6 years ago

I'm getting Ip , Json, KeyValue, LanguageCode, LeapDate

nickl- commented 6 years ago

58% complete... steady as she goes.

Nice! =)

IsmaelElias commented 6 years ago

I'm working on: