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

Update file names #1607

Merged
merged 5 commits into from
Dec 28, 2022
Merged

Update file names #1607

merged 5 commits into from
Dec 28, 2022

Conversation

neetcode-gh
Copy link
Owner

@neetcode-gh neetcode-gh commented Dec 27, 2022

DO NOT MERGE - I WILL MANUALLY MERGE SO I CAN UPDATE THE SITE

Added four digit prefix to each file to sort them by problem number. Normalized file names using leetcode problem url (https://leetcode.com/problems/**two-sum**).

Updated the site data json[1][2] accordingly and verified that it works[3].

Note: This only updated file names that are apart of the NC All list on the site (about 305 problems total.) I would've updated the entire list but we didn't collect URL & problem number for all of them yet.

Misc: Deleted a handful of duplicate files. Also updated github workflow script to account for 4 digits, but did not manually verify.

[1] updateSiteData.js
[2] .problemSiteData.json
[3] verifySiteData.js

@neetcode-gh neetcode-gh marked this pull request as draft December 27, 2022 16:12
@neetcode-gh neetcode-gh marked this pull request as ready for review December 27, 2022 16:40
@neetcode-gh neetcode-gh marked this pull request as draft December 27, 2022 16:40
Copy link
Collaborator

@Ahmad-A0 Ahmad-A0 left a comment

Choose a reason for hiding this comment

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

Everything looks fine, I moved the updateSiteData.js and verifySiteData.js files to the workflow folder (paths don't need to be changed) and gave them their own workflow which should run daily and fail if verifySiteData fails.

/** Script to verify code links in ./.problemSiteData.json */

const fs = require('fs');
const https = require('/opt/homebrew/lib/node_modules/sync-request');
Copy link
Owner Author

Choose a reason for hiding this comment

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

I think this dependency may need to be added to your github actions.

@neetcode-gh
Copy link
Owner Author

Thanks @Ahmad-A0 - just had a couple questions on the automated workflows, depending on what you think it might be better to add additional GH workflows in a separate PR.

@Ahmad-A0
Copy link
Collaborator

Yep sure, I'll open a new PR after this one is merged implementing any new workflows.

@Ahmad-A0
Copy link
Collaborator

I've also changed the base URL like you suggested, assuming you have no more tests to run on this branch.

@neetcode-gh neetcode-gh marked this pull request as ready for review December 28, 2022 15:53
@neetcode-gh
Copy link
Owner Author

I've also changed the base URL like you suggested, assuming you have no more tests to run on this branch.

Thanks for the review, and for helping so much over the last year! It will be nice to finally close some of these issues.

@neetcode-gh neetcode-gh merged commit 65bd087 into main Dec 28, 2022
@neetcode-gh neetcode-gh deleted the nc-refactor branch December 28, 2022 20:54
@abe-101
Copy link
Contributor

abe-101 commented Jan 5, 2023

Question: At this point do all file names have (up to) 4 leading zeros?

The reason I am asking is because the new leetcode-bot on the neetcode discord gets the solutions from this repo and sorta depends on a predictable naming scheme...

@Ahmad-A0
Copy link
Collaborator

Ahmad-A0 commented Jan 5, 2023

Question: At this point do all file names have (up to) 4 leading zeros?

The reason I am asking is because the new leetcode-bot on the neetcode discord gets the solutions from this repo and sorta depends on a predictable naming scheme...

Yep, all the problems linked from the site have 4 leading zeros.

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.

Dynamically link solutions to site? [chore] folder/file naming conventions
3 participants