-
-
Notifications
You must be signed in to change notification settings - Fork 554
Reorganize the x-common files #351
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
Conversation
For fun, this is the F# script I used to generate the new structure from the existing one: open System
open System.IO
let rootDir = @"D:\programmeren\_persoonlijk\x-common"
let (</>) dir file = Path.Combine [| dir; file |]
let createDirectoryIfNotExists directory =
if not <| Directory.Exists directory then
Directory.CreateDirectory directory |> ignore
let copyFile source target =
if File.Exists source then
File.Copy(source, target)
let createDirectory sourceMetadataFile =
let slug = Path.GetFileNameWithoutExtension sourceMetadataFile
let sourceDataFile = rootDir </> (sprintf "%s.json" slug)
let sourceDescriptionFile = rootDir </> (sprintf "%s.md" slug)
let targetDirectory = rootDir </> "exercises" </> slug
let targetMetadataFile = targetDirectory </> "metadata.yml"
let targetDataFile = targetDirectory </> "data.json"
let targetDescriptionFile = targetDirectory </> "description.md"
createDirectoryIfNotExists targetDirectory
copyFile sourceMetadataFile targetMetadataFile
copyFile sourceDataFile targetDataFile
copyFile sourceDescriptionFile targetDescriptionFile
let files =
Directory.EnumerateFiles(rootDir, "*.yml")
|> Seq.filter (fun x -> not <| x.EndsWith ".travis.yml")
|> Seq.iter createDirectory |
👍 for script. Should this PR move the existing files rather than adding new copies? |
I'd also like to see the individual filenames retain their slug prefix.
This way, if you copy a file elsewhere to work on it you still have some idea what the data is and we don't end up with 100's of files called |
I'm fairly certain the existing files should not be moved, as otherwise things will break. As for renaming the files, that seems very redundant to me. If you want to work on the files, you will probably clone the whole repository and then the directory name already tells you the context. But maybe other people disagree? |
This PR would be the 'moving all the problems at once' step. |
I agree it is redundant, but what value does the filename |
Not much, I agree. Perhaps it should be named |
Yeah, that's better. Or |
I'll rename the files to |
ef407f6
to
f464aec
Compare
@kytrinyx The test data JSON files have been renamed to |
Would you take a look at the CONTRIBUTING.md file and see if any references there need to be updated? |
f464aec
to
fe34f14
Compare
I've started updating the |
The CONTRIBUTING.md updates look good to me. |
Is this something we want to merge, or should it be kept unmerged for a while? |
Please keep unmerged.
|
I think the TODO list is something like this:
|
c99562f
to
5896827
Compare
@kytrinyx I've updated the PR to move the files instead of copying them. |
@ErikSchierboom The API change has been merged and is deploying. Would you mind rebasing this onto master to make sure we have all the latest changes and newest files? |
9eb4b97
to
974487b
Compare
@kytrinx I've rebased this PR onto the latest master and also ran my script again to pickup the latest changes. I'll be away for a couple of days after today by the way, so I hopefully this is enough for it to be merged. |
It's still showing +10k lines. I would expect a move to be almost zero if the + and - balance out from a move. |
I think it's because I forgot to remove the old files. I'll try to fix it tonight |
974487b
to
27f1e22
Compare
Great! |
My blind guess (without verification of whether the guess is correct) \r\n vs \n ? |
That would be my guess too |
27f1e22
to
cda8f98
Compare
@rbasso @petertseng It was indeed due to line-ending issues. I've fixed it and updated the PR. |
🎉 🎉 🎉 |
Looks great, thanks @ErikSchierboom ! ❤️ |
🎉 |
…r_Track Config for Gitter Room Chat on page
This PR reorganizes the X-common files as discussed in #269.