ubiquity / ts-template

A template repository for all @ubiquity projects.
2 stars 24 forks source link

Empty String `""` Code Review Warning Annotation #31

Closed 0x4007 closed 4 weeks ago

0x4007 commented 8 months ago

Annotate them with warnings in code review to more closely scrutinize the logic that interacts with the variable.

Rationale

I see a lot of abuse for empty strings. It makes code logic sloppy and more error prone. But since there are some legitimate uses for empty strings, we will just set a warning instead of error?

Examples

https://github.com/ubiquity/audit.ubq.fi/blob/08fba85a9a592ca2bda5eaeaa2ff3b9fdd4632be/static/scripts/audit-report/audit.ts#L26C1-L27C21
https://github.com/ubiquity/ubiquibot-kernel/blame/c553d5a7866c1ef76d4f589d8095c8bb751cbd49/src/github/types/config.ts#L29
https://github.com/ubiquity/pay.ubq.fi/pull/189/files#r1518549017

From codebase search: https://github.com/search?q=org%3Aubiquity+%5C%22%5C%22+language%3ATypeScript&type=code
Keyrxng commented 8 months ago

/start

ubiquibot[bot] commented 8 months ago

DeadlineMon, Mar 25, 8:54 AM UTC
Registered Wallet 0xAe5D1F192013db889b1e2115A370aB133f359765
Tips:
Keyrxng commented 5 months ago

/stop if it is still an open task I will pick it back up. Feel free to ref my PR if anyone wants to take this

ubiquibot[bot] commented 5 months ago
+ You have been unassigned from the task
Sadaf-A commented 4 months ago

/start

ubiquibot[bot] commented 4 months ago

Warning! This task was created over 118 days ago. Please confirm that this issue specification is accurate before starting.
DeadlineFri, Jul 5, 11:19 PM UTC
Registered Wallet 0x0BEd00438D57d07E3667b85Fa8EB86Af147C7025
Tips:
ubiquibot[bot] commented 3 months ago
# These linked pull requests are closed:  <a href="https://github.com/ubiquity/ts-template/pull/36">#36</a> 
jordan-ae commented 2 months ago

/start

ubiquity-os[bot] commented 2 months ago
Warning! This task was created over 179 days ago. Please confirm that this issue specification is accurate before starting.
DeadlineWed, Sep 4, 6:21 PM UTC
Registered Wallet 0x2F05fD58023B0a95d1866aa0A3b672cEf05945c5
Tips:
<ul>
<li>Use <code>/wallet 0x0000...0000</code> if you want to update your registered payment wallet address.</li>
<li>Be sure to open a draft pull request as soon as possible to communicate updates on your progress.</li>
<li>Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.</li>
<ul>
ubiquity-os[bot] commented 2 months ago

@jordan-ae, this task has been idle for a while. Please provide an update.

jordan-ae commented 2 months ago

/stop

ubiquity-os[bot] commented 2 months ago

# These linked pull requests are closed:  https://github.com/ubiquity/ts-template/pull/57 
ubiquity-os[bot] commented 1 month ago
! You have reached your max task limit. Please close out some tasks before assigning new ones.
ubiquity-os[bot] commented 1 month ago
! Failed to run comment evaluation. TypeError: Cannot read properties of undefined (reading 'wordValue')
ubiquity-os[bot] commented 1 month ago
! You have reached your max task limit. Please close out some tasks before assigning new ones.
ubiquity-os[bot] commented 1 month ago
! You have reached your max task limit. Please close out some tasks before assigning new ones.
ubiquity-os[bot] commented 1 month ago
! You have reached your max task limit. Please close out some tasks before assigning new ones.
ubiquity-os[bot] commented 1 month ago
! Failed to run comment evaluation. TypeError: Cannot read properties of undefined (reading 'wordValue')
ubiquity-os[bot] commented 1 month ago

@0x4007 the deadline is at Wed, Oct 9, 2:18 AM UTC

ubiquity-os[bot] commented 1 month ago
! Failed to run comment evaluation. TypeError: Cannot read properties of undefined (reading 'wordValue')
0x4007 commented 1 month ago
! Failed to run comment evaluation. TypeError: Cannot read properties of undefined (reading 'wordValue')

@gentlementlegen can you fix today and leverage Whilefoo environment config switcher

ubiquity-os[bot] commented 1 month ago

 [ 156.074 WXDAI ] 

@0x4007
Contributions Overview
ViewContributionCountReward
IssueTask1100
IssueSpecification155.92
IssueComment10.154
ReviewComment50
Conversation Incentives
CommentFormattingRelevanceReward
Annotate them with warnings in code review to more closely scrut…
18.64
content:
  content:
    p:
      score: 0
      elementCount: 2
    h3:
      score: 1
      elementCount: 2
    h6:
      score: 1
      elementCount: 4
    ul:
      score: 1
      elementCount: 3
    li:
      score: 0.5
      elementCount: 3
    hr:
      score: 0
      elementCount: 1
  result: 10.5
regex:
  wordCount: 177
  wordValue: 0.1
  result: 8.14
155.92
@gentlementlegen can you fix today and leverage Whilefoo enviro…
0.77
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 11
  wordValue: 0.1
  result: 0.77
0.20.154
Resolves https://github.com/ubiquity/ts-template/issues/31Curr…
0
content:
  content:
    p:
      score: 0
      elementCount: 3
  result: 0
regex:
  wordCount: 67
  wordValue: 0
  result: 0
0.80
I got annotations working on the files view but I can't get the …
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.40
Currently matches any instance of `""` but with regex ca…
0
content:
  content:
    p:
      score: 0
      elementCount: 2
  result: 0
regex:
  wordCount: 43
  wordValue: 0
  result: 0
0.70
It's a warning not an error. This expresses that the reviewers s…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 59
  wordValue: 0
  result: 0
0.60
Also I just realized that it doesn't display annotations on GitH…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 26
  wordValue: 0
  result: 0
0.30

 [ 1.192 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
ReviewComment11.192
Conversation Incentives
CommentFormattingRelevanceReward
@0x4007 It seems you merged this with empty strings: https://git…
1.49
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.81.192
ubiquity-os[bot] commented 4 weeks ago

 [ 156.151 WXDAI ] 

@0x4007
Contributions Overview
ViewContributionCountReward
IssueTask1100
IssueSpecification155.92
IssueComment10.231
ReviewComment50
Conversation Incentives
CommentFormattingRelevanceReward
Annotate them with warnings in code review to more closely scrut…
18.64
content:
  content:
    p:
      score: 0
      elementCount: 2
    h3:
      score: 1
      elementCount: 2
    h6:
      score: 1
      elementCount: 4
    ul:
      score: 1
      elementCount: 3
    li:
      score: 0.5
      elementCount: 3
    hr:
      score: 0
      elementCount: 1
  result: 10.5
regex:
  wordCount: 177
  wordValue: 0.1
  result: 8.14
155.92
@gentlementlegen can you fix today and leverage Whilefoo enviro…
0.77
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 11
  wordValue: 0.1
  result: 0.77
0.30.231
Resolves https://github.com/ubiquity/ts-template/issues/31Curr…
0
content:
  content:
    p:
      score: 0
      elementCount: 3
  result: 0
regex:
  wordCount: 67
  wordValue: 0
  result: 0
0.80
I got annotations working on the files view but I can't get the …
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 19
  wordValue: 0
  result: 0
0.50
Currently matches any instance of `""` but with regex ca…
0
content:
  content:
    p:
      score: 0
      elementCount: 2
  result: 0
regex:
  wordCount: 43
  wordValue: 0
  result: 0
0.70
It's a warning not an error. This expresses that the reviewers s…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 59
  wordValue: 0
  result: 0
0.60
Also I just realized that it doesn't display annotations on GitH…
0
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 26
  wordValue: 0
  result: 0
0.40

 [ 1.192 WXDAI ] 

@gentlementlegen
Contributions Overview
ViewContributionCountReward
ReviewComment11.192
Conversation Incentives
CommentFormattingRelevanceReward
@0x4007 It seems you merged this with empty strings: https://git…
1.49
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 24
  wordValue: 0.1
  result: 1.49
0.81.192
gentlementlegen commented 2 weeks ago

@0x4007 I should have tested this, but it will always crash if a user opens a pull request because it uses variables from secrets that are not accessible, I will fix that.