Skip to content

Commit

Permalink
chore: fix empty string checker to correctly count violations
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Oct 8, 2024
1 parent e7149c3 commit d7312bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/empty-string-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function parseDiffForEmptyStrings(diff: string) {

if (inHunk && line.startsWith("+")) {
// Check for empty strings in TypeScript syntax
if (/^\+.*?(?:=\s*["'`]{2}(?!\s*[,;])|:\s*["'`]{2}(?!\s*[,;]))/.test(line)) {
if (/^\+.*""/.test(line)) {

Check warning on line 103 in .github/empty-string-checker.ts

View workflow job for this annotation

GitHub Actions / check-for-empty-strings

Empty string found: if (/^\+.*""/.test(line)) {
// Ignore empty strings in comments
if (!line.trim().startsWith("//") && !line.trim().startsWith("*")) {
// Ignore empty strings in template literals
Expand Down

0 comments on commit d7312bf

Please sign in to comment.