Skip to content

Ruike enforce no space in file name#1454

Merged
one-community merged 2 commits intodevelopmentfrom
ruike_enforce_no_space_in_file_name
Dec 23, 2023
Merged

Ruike enforce no space in file name#1454
one-community merged 2 commits intodevelopmentfrom
ruike_enforce_no_space_in_file_name

Conversation

@StrawberryCalpico
Copy link
Copy Markdown
Contributor

Description

Remove all files with filename contains a white space, and enforce rule by setting .gitignore

Related PRS (if any):

N/A

Main changes explained:

Changed several files' filename, replace ' ' with '_'
add **\ ** in gitignore to ignore changes with whitespace in the filename

How to test:

  1. check into current branch
  2. do npm install (optional)
  3. go to the parent directory of frontend/backend folder, for example, the Github folder
  4. run the following python file and make sure no file path was printed
import os

backend = "HGNRest"
frontend = "HighestGoodNetworkApp"

def checkfile(folderName):
        for fileName in os.scandir(folderName):
                if os.path.isfile(fileName) and ' ' in os.path.basename(fileName):
                        print(os.path.relpath(fileName))
                elif os.path.isdir(fileName):
                        checkfile(fileName)

checkfile(backend)
checkfile(frontend)

  1. can also test by creating new file with filename contains ' ', check that there's no change in git

Screenshots or videos of changes:

add a new file that contains whitespace in filename
Screen Shot 2023-10-25 at 8 41 36 PM
i was using github desktop, make sure there's no local change
Screen Shot 2023-10-25 at 8 42 48 PM

Note:

Make sure when run the script, the frontend/backend folder are in the same directory
such as
|| /Github
|| => *.py(replace * with any name)
|| => /frontend
|| => /backend
and run python3 *.py(replace * with any name)

Copy link
Copy Markdown
Contributor

@sxiong5 sxiong5 left a comment

Choose a reason for hiding this comment

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

Hey @StrawberryCalpico, I have run the Python, and everything looks good. Nice job!

Screenshot 2023-10-26 at 13 16 44

Copy link
Copy Markdown
Contributor

@tsunami776 tsunami776 left a comment

Choose a reason for hiding this comment

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

Hi @StrawberryCalpico, I ran the python test you provided for dev and your branch. I found files that not in node_modules now do not have space in their file names. One minor question I wondered is if you can skip checking files in node_modules and .git. Nice work overall!
dev:
CleanShot 2023-10-26 at 15 39 47

Your branch:
CleanShot 2023-10-26 at 15 35 19

Copy link
Copy Markdown

@ChirayuRai ChirayuRai left a comment

Choose a reason for hiding this comment

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

I checked out your PR, and it looks good! It only shows one space in node_modules in the backend folder. However, I don't know if that's important and should be something to consider? In the future it might be better to just skip over the folders in the gitignore for each directory or something.

Screenshot 2023-10-27 at 4 39 32 PM

Copy link
Copy Markdown
Contributor

@Iris-Song Iris-Song left a comment

Choose a reason for hiding this comment

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

HI, I have tested your PR. It works as intended. Good job.
Screenshot 2023-10-28 at 10 56 16

Copy link
Copy Markdown
Contributor

@yaow62023 yaow62023 left a comment

Choose a reason for hiding this comment

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

I have tested your pr, run the python code. No error at this pr.

Screenshot 2023-10-28 at 6 57 54 PM

Copy link
Copy Markdown

@Shubhu0 Shubhu0 left a comment

Choose a reason for hiding this comment

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

Hi @StrawberryCalpico Tested and reviewed your PR and it is working as intended.

image

Copy link
Copy Markdown
Contributor

@zuhang2000 zuhang2000 left a comment

Choose a reason for hiding this comment

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

Hi, I've tested your PR following your instructions. The code passes without a error. It reports the results as expected. Good job.
Screenshot 2023-10-28 at 11 41 04 PM

Copy link
Copy Markdown
Contributor

@Aishwaryak01 Aishwaryak01 left a comment

Choose a reason for hiding this comment

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

Hi Ruike,
Went through the regex provided in the .gitignore file to remove the space from the filename. It looks good to me. Approved!

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 73ac199 into development Dec 23, 2023
@EvianTan EvianTan deleted the ruike_enforce_no_space_in_file_name branch July 6, 2025 04:40
@ManeeshBuddha21
Copy link
Copy Markdown

Tested alongside Frontend PR #3647, the frontend returns the “Failed to post to LinkedIn” error.

@Vinay944924
Copy link
Copy Markdown
Contributor

Tested the PR locally and have provided the screenshot in Frontend PR-3647

Copy link
Copy Markdown

@Vikas-8055 Vikas-8055 left a comment

Choose a reason for hiding this comment

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

Hi, I've tested your PR. The code passes without a error.

Screenshot 2026-01-15 at 8 36 59 PM

Copy link
Copy Markdown

@Shravan-neelamsetty Shravan-neelamsetty left a comment

Choose a reason for hiding this comment

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

Hi, I've tested your PR. The code passes.
12

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.