RepoSense icon indicating copy to clipboard operation
RepoSense copied to clipboard

Use less restrictive regex for author name in @@author tags

Open anubh-v opened this issue 4 years ago • 9 comments

Currently, the regex used to validate names in @@author some-randomeuser tags is: [a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]

This regex ensures the author name has at least 2 consecutive alphanumeric characters.

As discussed in this comment, we can consider using a less restrictive regex, so that tags such as @@author --myname-- are accepted.

anubh-v avatar Mar 06 '20 04:03 anubh-v

@jylee-git after some thought, I do not really see a reason we might need a regex validation at all for the author name given in @@author tags.

(if no author name is provided, the tag is consider an end tag )

Do you see any need for a regex validation?

I did discuss with Prof, and there isn't a specific name requirement for the modules.

anubh-v avatar Mar 26 '20 06:03 anubh-v

I don't think there's a need for any validations required for the author names/IDs.

An author ID should be valid as long as it's not empty.

jinyao-lee avatar Apr 10 '20 07:04 jinyao-lee

I don't think there's a need for any validations required for the author names/IDs.

I agree with this. Shall we remove the regex validation then? @fzdy1914 would you agree?

anubh-v avatar Apr 11 '20 08:04 anubh-v

Hello, I am wondering if this issue is still under discussion, or will it be acceptable for me to work on this issue?

HCY123902 avatar Dec 21 '20 16:12 HCY123902

I don't think there's a need for any validations required for the author names/IDs.

I agree with this. Shall we remove the regex validation then? @fzdy1914 would you agree?

I am OK with it.

fzdy1914 avatar Dec 22 '20 03:12 fzdy1914

@fzdy1914 is this suitable for first-timers?

damithc avatar Mar 25 '21 15:03 damithc

Yes, it is quite simple to remove the validation.

fzdy1914 avatar Mar 26 '21 13:03 fzdy1914

Note for first timers who want to work on this issue:

The basic idea is to change or remove the validation for the author name tag located in AnnotatorAnalyzer.java by modifying theREGEX_AUTHOR_NAME_FORMAT argument.

https://github.com/reposense/RepoSense/blob/451f11b74cb895b079c14316a4fd323f2eccff1c/src/main/java/reposense/authorship/analyzer/AnnotatorAnalyzer.java#L17-L21

You may need to check that the unit and system test cases still passes after making the change by running the commands gradlew test and gradlew systemtest respectively.

Here is the explanation about the usage of author tag.

HCY123902 avatar Mar 29 '21 05:03 HCY123902

Hi @damithc can I confirm that no one is currently working on this? I would like to take on this issue as a first timer.

bingsen0806 avatar Jun 21 '22 17:06 bingsen0806

Hi, could I try taking up this issue?

RyanCheungJF avatar Dec 14 '22 14:12 RyanCheungJF

@RyanCheungJF Sure, I've assigned you the issue.

dcshzj avatar Dec 15 '22 02:12 dcshzj

Hi, given that the last PR was last modified a month ago, can I try taking this issue?

sikai00 avatar Jan 13 '23 06:01 sikai00

Hi, given that the last PR was last modified a month ago, can I try taking this issue?

yeah sure. However, please consider discussing it with @RyanCheungJF about it first. You may need to continue the work from #1846 instead of starting again on your own

HCY123902 avatar Jan 13 '23 06:01 HCY123902

However, please consider discussing it with @RyanCheungJF about it first.

Understood, I will try to contact him regarding this!

sikai00 avatar Jan 13 '23 06:01 sikai00

Hi! Sorry for being inactive, but Si Kai has contacted me and I'm ok with him taking over the issue 👍🏻. Since he has created a new PR, I'll close my PR in a day if there's nothing else. Thanks!

RyanCheungJF avatar Jan 14 '23 02:01 RyanCheungJF