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

add an action to remove trailing spaces when opening a PR #551

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

miyaliu666
Copy link
Member

Checklist:

Remove extra trailing spaces from each line. This one, along with freeCodeCamp/articles-auto-translate-action#12, is made to solve the issue #550

if [ -n "$file" ]; then
echo "Processing file: $file"
# Remove trailing spaces from each line in the file
sed -i 's/ $//g' "$file"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sed -i 's/ $//g' "$file"
pnpx prettier --write "$file"

Prettier can fix all kinds of formatting issues including the tail spaces.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for your comment, @TechQuery.

I think we eventually want to utilize Prettier for formatting, but what we are currently trying to do is a little different. We want to intentionally make changes to every lines just to make it easier for proofreaders to comment on any lines in PRs.

There might be a better solution, but let's try this way first.

Copy link
Collaborator

@RafaelDavisH RafaelDavisH left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@sidemt sidemt merged commit 441ea7d into freeCodeCamp:main Dec 11, 2024
@miyaliu666 miyaliu666 deleted the feat/format-pr-files branch December 12, 2024 03:27
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.

4 participants