-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: v4 #1
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
base: v4
Are you sure you want to change the base?
refactor: v4 #1
Conversation
I think this is right.
I still think this is right.
|
Tests are throwing lots of errors, but they pass!? |
|
|
||
| // Search for specific filename | ||
| // deno-lint-ignore no-constant-condition | ||
| if (false) { |
Check warning
Code scanning / CodeQL
Unreachable statement Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we need to remove the unreachable code block. This involves deleting the if (false) statement and the code inside it. This will clean up the code and remove the unreachable statement.
- Remove the
if (false)statement and its block from lines 43 to 45. - Similarly, remove the
if (false)statement and its block from lines 49 to 51.
-
Copy modified lines R42-R45 -
Copy modified lines R48-R51
| @@ -41,12 +41,12 @@ | ||
| // Search for specific filename | ||
| // deno-lint-ignore no-constant-condition | ||
| if (false) { | ||
| result.from = "filename" | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| // Search for specific extension | ||
| // deno-lint-ignore no-constant-condition | ||
| if (false) { | ||
| result.from = "extension" | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|
||
| // Search for specific extension | ||
| // deno-lint-ignore no-constant-condition | ||
| if (false) { |
Check warning
Code scanning / CodeQL
Unreachable statement Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we need to remove the unreachable code block. This involves deleting the if (false) statement and the code within its block. This will clean up the code and remove any dead code that serves no purpose.
- Remove the
if (false)statement and its block on lines 48-51. - Ensure that the removal does not affect the functionality of the rest of the code.
-
Copy modified line R48
| @@ -47,6 +47,3 @@ | ||
| // Search for specific extension | ||
| // deno-lint-ignore no-constant-condition | ||
| if (false) { | ||
| result.from = "extension" | ||
| } | ||
|
|
||
|
|
| // Pull request created | ||
| case "PullRequestEvent": { | ||
| return null | ||
| if (!["opened", "edited", "closed", "reopened", "assigned", "unassigned"].includes(payload.action)) { |
Check warning
Code scanning / CodeQL
Unreachable statement Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we need to remove the unreachable if statement and the subsequent code that is also unreachable. This will clean up the code and remove any confusion about the intended logic. Specifically, we should remove lines 197-203, as they will never be executed.
| @@ -196,9 +196,2 @@ | ||
| return null | ||
| if (!["opened", "edited", "closed", "reopened", "assigned", "unassigned"].includes(payload.action)) { | ||
| return null | ||
| } | ||
| if (!matchPatterns(users.matching, payload.pull_request.user.login)) { | ||
| return null | ||
| } | ||
| return Object.assign(event, { type: "pullrequest", action: payload.action, ...this.pullrequest(payload.pull_request) }) | ||
| } |
| // Release published | ||
| case "ReleaseEvent": { | ||
| return null | ||
| if (payload.action !== "published") { |
Check warning
Code scanning / CodeQL
Unreachable statement Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we need to remove the unreachable return null statement on line 220. This will allow the subsequent if statement and its block to be evaluated and executed as intended. This change will not alter the existing functionality but will ensure that the code logic is correctly implemented.
| @@ -219,3 +219,2 @@ | ||
| case "ReleaseEvent": { | ||
| return null | ||
| if (payload.action !== "published") { |
| parsed[key] ??= value | ||
| { | ||
| const k = yaml({ [key]: null }, { inline: true }).match(kv)?.groups?.key.trim() | ||
| const a = typeof value === "undefined" ? `${value}` : yaml({ [key]: value }, { inline: true }).match(kv)?.groups?.value.trim() |
Check warning
Code scanning / CodeQL
Implicit operand conversion Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we need to make the conversion from undefined to a string explicit. This can be done by using a conditional (ternary) operator to check if value is undefined and then explicitly converting it to an empty string or another appropriate default value. This will make the code clearer and prevent any unintended behavior caused by implicit conversions.
-
Copy modified line R110
| @@ -109,3 +109,3 @@ | ||
| const k = yaml({ [key]: null }, { inline: true }).match(kv)?.groups?.key.trim() | ||
| const a = typeof value === "undefined" ? `${value}` : yaml({ [key]: value }, { inline: true }).match(kv)?.groups?.value.trim() | ||
| const a = typeof value === "undefined" ? "" : yaml({ [key]: value }, { inline: true }).match(kv)?.groups?.value.trim() | ||
| const b = yaml({ [key]: parsed[key] }, { inline: true }).match(kv)?.groups?.value.trim() |
astral broke in Deno 2, so I got to migrate all of the the imports! :)
Apparently Deno is a lot less sandboxed than it used to be :(
On normal Alpine, Deno segfaults. Hopefully this will fix it.
That's why the sha256 was different.
This comment was marked as off-topic.
This comment was marked as off-topic.
Thank you! ❤️
I do use squash-commits, but the full CI workflow doesn't run on PRs, so I'm just pushing directly for now. If you want to discuss the setup more, feel free to create a new discussion to keep this PR focused. |
I'm not going to pretend like I've got lots of time to resume lowlighter#1542, but I'd at least like to make sure it doesn't get lost to the stale bot.