Skip to content

Change contest file naming#55

Merged
A7Lavinraj merged 6 commits intoA7Lavinraj:mainfrom
nathy-cpu:main
Feb 13, 2025
Merged

Change contest file naming#55
A7Lavinraj merged 6 commits intoA7Lavinraj:mainfrom
nathy-cpu:main

Conversation

@nathy-cpu
Copy link
Contributor

I have added a helper function in the Filesystem:save function to handle naming filenames of contest question. After this change, all the files created will be named like A_Problem_Name instead of AProblemName. I think this will be more readable and easier to arrange and archive the solution files for future use.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have run and passed all predefined tests.

Add helper function inside Filesystem:save to convert the filename from PascalCase to Capitalised_Snake_Case
@A7Lavinraj
Copy link
Owner

Nice work! Just give me some time to validate it so that nothing gets break

@A7Lavinraj
Copy link
Owner

@nathy-cpu looks like you forget about an edge case in to_snake_case. This converts ABC to A_B_C which is not expected. It means to_snake_case does not handling repeated upper case letters correctly. So please take this edge case in to account and try again!

Your output for ABC should be ABC

Fix to_snake_case function to handle consecutive capital letters
Fix `to_snake_case` function to handle spaces and numbers
@nathy-cpu
Copy link
Contributor Author

nathy-cpu commented Feb 12, 2025

@nathy-cpu looks like you forget about an edge case in to_snake_case. This converts ABC to A_B_C which is not expected. It means to_snake_case does not handling repeated upper case letters correctly. So please take this edge case in to account and try again!

Your output for ABC should be ABC

I have fixed the issue and tried to handle more edge cases as well. This time I hope things go as expected.

@A7Lavinraj
Copy link
Owner

Looks like your changes have some formatting issues. You can use Makefile to fix that just use make fmt and it will fix the formatting, also if want a full check then use make all.

@nathy-cpu
Copy link
Contributor Author

Oh my bad. It is fixed now

@A7Lavinraj
Copy link
Owner

A7Lavinraj commented Feb 13, 2025

Congratulations, but next time try to write your commit messages according to conventional commits rules. This time i doing a squash merge

@A7Lavinraj A7Lavinraj merged commit b836963 into A7Lavinraj:main Feb 13, 2025
3 checks passed
@nathy-cpu
Copy link
Contributor Author

Understood. This is my first pull request ever, so thank you for understanding :)

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.

2 participants