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

chore: exclude files with empty strings checker #88

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

obeys
Copy link
Contributor

@obeys obeys commented Nov 26, 2024

Resolves #82

Changes:

  • Added the ability to pass file paths to no-empty-strings.yml
  • Changed empty-string-checker.ts to take in file paths from the workflow
  • If the current file matches one excluded files it skips the file

QA:

How to QA and setup:

  • Create a file with empty strings
  • Add the file to no-empty-strings.yml EXCLUDED_FILES
  • Run Action

@ubiquity-os-deployer
Copy link

ubiquity-os-deployer bot commented Nov 26, 2024

@obeys
Copy link
Contributor Author

obeys commented Nov 28, 2024

@rndquu could you maybe look at this, unsure why no reviewer was assigned 🤔

@rndquu rndquu self-requested a review November 29, 2024 15:25
Copy link
Member

@rndquu rndquu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this PR which introduces an empty string and passes empty strings check CI while the expected behavior for the CI to fail.

.github/empty-string-checker.ts Outdated Show resolved Hide resolved
.github/workflows/no-empty-strings.yml Outdated Show resolved Hide resolved
@rndquu rndquu marked this pull request as draft November 29, 2024 15:47
@obeys
Copy link
Contributor Author

obeys commented Nov 29, 2024

@rndquu I believe that the reason the CI passed was because you used single quote strings ('') which was not detected by the regex.

Normally from what i've figured the linter would convert all the single quote strings to double quotes which would've been detected by the CI. I've changed the regex so it would match single quote strings, but that made it so the regex itself would also be detected and I know you wanted me to remove the default value from EXCLUDED_FILES.

Here's the CI https://github.com/wellneverknow/ts-template/actions/runs/12089305564
and PR: wellneverknow#3

I can either:

  1. Add .github/empty-string-checker.ts back to EXCLUDED_FILES so the regex wouldn't fail the CI
  2. keep the old regex which only matches double quotes ("") which should detect empty strings as long as someone doesn't push without ignoring the linter.

Let me know which works best for you!

@obeys obeys requested a review from rndquu December 3, 2024 00:37
Copy link

ubiquity-os bot commented Dec 9, 2024

@obeys, this task has been idle for a while. Please provide an update.

@obeys
Copy link
Contributor Author

obeys commented Dec 9, 2024

waiting on @rndquu

Copy link
Member

@rndquu rndquu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this PR which assigns an empty string to a variable.

Now check this commit which removes the EXCLUDED_FILES env variable. The empty string CI check is passed for that commit although the expected behavior for the CI to fail since the EXCLUDED_FILES env variable is no longer set.

@rndquu
Copy link
Member

rndquu commented Dec 12, 2024

@rndquu I believe that the reason the CI passed was because you used single quote strings ('') which was not detected by the regex.

Normally from what i've figured the linter would convert all the single quote strings to double quotes which would've been detected by the CI. I've changed the regex so it would match single quote strings, but that made it so the regex itself would also be detected and I know you wanted me to remove the default value from EXCLUDED_FILES.

Here's the CI https://github.com/wellneverknow/ts-template/actions/runs/12089305564 and PR: wellneverknow#3

I can either:

  1. Add .github/empty-string-checker.ts back to EXCLUDED_FILES so the regex wouldn't fail the CI
  2. keep the old regex which only matches double quotes ("") which should detect empty strings as long as someone doesn't push without ignoring the linter.

Let me know which works best for you!

You may keep the old regex which only matches double quotes (""), this task for excluding certain files from the CI check

@obeys
Copy link
Contributor Author

obeys commented Dec 12, 2024

Check this PR which assigns an empty string to a variable.

Now check this commit which removes the EXCLUDED_FILES env variable. The empty string CI check is passed for that commit although the expected behavior for the CI to fail since the EXCLUDED_FILES env variable is no longer set.

I've added EXCLUDED_FILES to the initial required environment variables check so the CI now will fail.

Here's a check failing because EXCLUDED_FILES was not found
Here's another check failing because EXCLUDED_FILES was found but there was an empty string in main.ts

.github/workflows/no-empty-strings.yml Outdated Show resolved Hide resolved
@obeys
Copy link
Contributor Author

obeys commented Dec 13, 2024

@rndquu EXCLUDED_FILES is now optional and there's no empty strings in empty-string-checker.ts

@rndquu rndquu marked this pull request as ready for review December 19, 2024 14:28
@rndquu rndquu self-requested a review December 19, 2024 14:28
@rndquu rndquu merged commit 1d6e41b into ubiquity:development Dec 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty String Check workflow: exclude files
2 participants