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

Empty String Check workflow: exclude files #82

Closed
rndquu opened this issue Nov 19, 2024 · 8 comments · Fixed by #86 or #88
Closed

Empty String Check workflow: exclude files #82

rndquu opened this issue Nov 19, 2024 · 8 comments · Fixed by #86 or #88

Comments

@rndquu
Copy link
Member

rndquu commented Nov 19, 2024

Check this failing Empty String Check workflow. It fails because there're empty strings in the following places:

So there are legit cases when empty strings can be used.

What should be done:

  • add a feature of excluding some files from empty strings check in the no-empty-strings.yml workflow
@Keyrxng
Copy link
Contributor

Keyrxng commented Nov 21, 2024

The run is failing due to permission reasons @rndquu, this can be closed as not planned probs.

POST /repos/ubiquity-os/ubiquity-os-plugin-installer/check-runs - 403 with id 1B40:4890C:25FDE3:2654FA:673C973B in 159ms
Error: An error occurred: Resource not accessible by integration - https://docs.github.com/rest/checks/runs#create-a-check-run

@rndquu
Copy link
Member Author

rndquu commented Nov 21, 2024

The run is failing due to permission reasons @rndquu, this can be closed as not planned probs.

POST /repos/ubiquity-os/ubiquity-os-plugin-installer/check-runs - 403 with id 1B40:4890C:25FDE3:2654FA:673C973B in 159ms
Error: An error occurred: Resource not accessible by integration - https://docs.github.com/rest/checks/runs#create-a-check-run

There're still empty string warnings so the CI would fail anyway

@Keyrxng
Copy link
Contributor

Keyrxng commented Nov 21, 2024

conclusion: violations.length > 0 ? "failure" : "success",

You are right, my mistake, the original vision for it was that it would only present a diff warning but not crash CI so it would always succeed essentially but the diff would have it's comments

@obeys
Copy link
Contributor

obeys commented Nov 25, 2024

/start

@obeys
Copy link
Contributor

obeys commented Nov 25, 2024

trying to push changes but running into some errors with ESint

yarn run v1.22.22
$ /workspaces/ts-template/node_modules/.bin/lint-staged
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
  ❯ package.json — 2 files
    ❯ *.ts — 1 file
      ✔ yarn prettier --write
      ✖ eslint --fix [FAILED]
    ↓ src/**.{ts,json} — no files
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 8.56.0

Error: ESLint configuration in .eslintrc » plugin:sonarjs/recommended is invalid:
        - Unexpected top-level property "name".

Referenced from: /workspaces/ts-template/.eslintrc
    at ConfigValidator.validateConfigSchema (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2177:19)
    at ConfigArrayFactory._normalizeConfigData (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3019:19)
    at ConfigArrayFactory._loadExtendedPluginConfig (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3239:25)
    at ConfigArrayFactory._loadExtends (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3154:29)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3095:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory.loadInDirectory (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
husky - pre-commit script failed (code 1)

@rndquu
Copy link
Member Author

rndquu commented Nov 26, 2024

trying to push changes but running into some errors with ESint

yarn run v1.22.22
$ /workspaces/ts-template/node_modules/.bin/lint-staged
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
  ❯ package.json — 2 files
    ❯ *.ts — 1 file
      ✔ yarn prettier --write
      ✖ eslint --fix [FAILED]
    ↓ src/**.{ts,json} — no files
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 8.56.0

Error: ESLint configuration in .eslintrc » plugin:sonarjs/recommended is invalid:
        - Unexpected top-level property "name".

Referenced from: /workspaces/ts-template/.eslintrc
    at ConfigValidator.validateConfigSchema (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2177:19)
    at ConfigArrayFactory._normalizeConfigData (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3019:19)
    at ConfigArrayFactory._loadExtendedPluginConfig (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3239:25)
    at ConfigArrayFactory._loadExtends (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3154:29)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3095:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory.loadInDirectory (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/workspaces/ts-template/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
husky - pre-commit script failed (code 1)

Should be fine when #86 is merged

Copy link

ubiquity-os bot commented Dec 19, 2024

+ Evaluating results. Please wait...

Copy link

ubiquity-os bot commented Dec 19, 2024

 [ 25 WXDAI ] 

@obeys
Contributions Overview
ViewContributionCountReward
IssueTask125
Conversation Incentives
CommentFormattingRelevancePriorityReward

 [ 3.24125 WXDAI ] 

@Keyrxng
Contributions Overview
ViewContributionCountReward
IssueComment23.24125
Conversation Incentives
CommentFormattingRelevancePriorityReward
The run is failing due to permission reasons @rndquu, this can b…
6.59
content:
  content:
    p:
      score: 0
      elementCount: 2
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 26
  wordValue: 0.1
  result: 1.59
0.511.45125
https://github.com/ubiquity/ts-template/blob/7b94011f7e080380dd5…
7.15
content:
  content:
    p:
      score: 0
      elementCount: 2
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 37
  wordValue: 0.1
  result: 2.15
111.79

 [ 25 WXDAI ] 

@rndquu
⚠️ Your rewards have been limited to the task price of 25 WXDAI.
Contributions Overview
ViewContributionCountReward
IssueSpecification124.83
IssueComment25.894
ReviewComment843.141
Conversation Incentives
CommentFormattingRelevancePriorityReward
Check [this](https://github.com/ubiquity-os/ubiquity-os-plugin-i…
24.83
content:
  content:
    p:
      score: 0
      elementCount: 6
    ul:
      score: 0
      elementCount: 2
    li:
      score: 0.5
      elementCount: 4
    a:
      score: 5
      elementCount: 4
  result: 22
regex:
  wordCount: 51
  wordValue: 0.1
  result: 2.83
1124.83
There're still empty string warnings so the CI would fail anyway
0.83
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 12
  wordValue: 0.1
  result: 0.83
0.810.664
Should be fine when https://github.com/ubiquity/ts-template/pull…
5.46
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.515.23
Check [this](https://github.com/rndquu/ts-template/pull/7) PR wh…
11.44
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 2
  result: 10
regex:
  wordCount: 23
  wordValue: 0.1
  result: 1.44
0.5110.72
Check [this](https://github.com/rndquu/ts-template/pull/7) PR wh…
17.64
content:
  content:
    p:
      score: 0
      elementCount: 2
    a:
      score: 5
      elementCount: 3
  result: 15
regex:
  wordCount: 47
  wordValue: 0.1
  result: 2.64
0.7116.848
Empty string should be removed
0.39
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 5
  wordValue: 0.1
  result: 0.39
0.910.351
Default value for `EXCLUDED_FILES` should be removed
0.46
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 6
  wordValue: 0.1
  result: 0.46
0.910.414
What's the point of keeping this variable empty? Can't we simply…
1.28
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 20
  wordValue: 0.1
  result: 1.28
0.811.024
Refactor the code then, so that the `EXCLUDED_FILES` env…
6.54
content:
  content:
    p:
      score: 0
      elementCount: 1
    a:
      score: 5
      elementCount: 1
  result: 5
regex:
  wordCount: 25
  wordValue: 0.1
  result: 1.54
0.916.386
YesI don't understand the question. Make sure:1. `EXCL…
7.11
content:
  content:
    p:
      score: 0
      elementCount: 5
    ol:
      score: 0
      elementCount: 1
    li:
      score: 0.5
      elementCount: 2
    a:
      score: 5
      elementCount: 1
  result: 6
regex:
  wordCount: 17
  wordValue: 0.1
  result: 1.11
0.916.999
You may keep the old regex which only matches double quotes ("")…
1.33
content:
  content:
    p:
      score: 0
      elementCount: 1
  result: 0
regex:
  wordCount: 21
  wordValue: 0.1
  result: 1.33
0.310.399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants