-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
WIP: Issue #640 #667
WIP: Issue #640 #667
Conversation
Thanks for your work.
Yes there are no test cases for now, it would be great if you add them also by creating the test folder as per code extension standards, so it would easy for me to evaluate and publish easily. Settings Sync needs test cases and I'm always looking forward to add them but due to time constraints i couldn't Questions:
By the host meaning, I mean tht environment name actaully. There are two things if you look into the comment: #640 (comment)
User can have For example: User have Mac in both Home and Office, they might have different settings managed.
Adding comment will be good option if user wants to see the office environment setting and want to use those settings as a part of
Sorry i dont understand, Would you please explain it. Thanks ❇️ for your work so far ! |
Take as example {
// @sync os=mac host=Laptop --multiple white spaces or tabs
windows.zoom: 1,
// @sync os=windows --multiple line breaks after pragma. I think it should be only one line break strictly
windows.zoom: 2,
...
} To leave it clear:
I will write tests using BDD pattern. I was thinking in jest or mocha. Let me know if you have any preference.
Is it already loaded in the code or I had to load the Sync Global settings file? The TODO list:
Ideas:
|
Yes one strict line break should be supported. OS and host should be case insensitive. Can u explain about the validity of comment u have asked? Please use mocha for writing test cases. Also integrate running those test cases with build if possible to steam line the processes via npm build. Settings Sync global settings always load on download or upload If host config is null or undefined it should only all the os settings that are @sync os=windows And general settings It should also apply any if the @sync os=windows host=abc Please Make sure while uploading it should verify the user have written correct os name or host name- validation checks. Yes checking key from process.env is also good option that we can implement. Feel free to ask questions! |
Cool, so, to sum this up:
Another thing would be great if a setting can be applied to multiple host or OS. E.g.
and last, it would be great to have a prompt with all the pragma settings applied to the current host. I will let you know when this is ready! |
Perfect! Yes that is great but now let's keep it outside from this PR scope. |
…rking while compiling.
…n every orther. Remove whitespaces before upload. Alert user if OS value is not a valid OS.
@shanalikhan I think I finished. Could you give me feedback?
The key of this feature is that before upload the settings we make sure that it only contains valid pragmas. Then when settings are downloaded, we process those pragmas and insert comments if we have to. The code can accept any string. So when #258 is ready we can support any custom file with When this PR is merged we could implement OR operator on each pragma. E.g.: |
… Only insert comments if it doesn't match with matchine os or host or env. Uncomment line before write if it matched.
@shanalikhan about my last commit. Regards |
… More redeable settings json for testing.
Yes thats perfect ! Public Wiki edit is enabled. When this PR is complete and you have time. It would be great if you can create a separate page over there and display the work details. Thanks. |
I will add a wiki page for this. Could you check that? I think this is ready to merge. Let me know to close this PR |
…ted. Get OS from OsType enum. Remove os.hostName()
…commas are removed. Must check this. If not valid OS is detected inform user. Added function to remove comments from text.
…"Launch Test". Remove javascript files.
Thanks @ioprotium ! Feel free to improve where you think it can :) |
You are welcome! It's so cool to get involved in open source projects that I use a lot! |
I was just looking for a feature like this, thanks for implementing it @ioprotium! |
Notes:
As specified, initially I made 2 regex patterns:
/\/\/\s\@sync\s(os=(\w+)\s?)?(host=(\w+)\s?)?\n(.+),?/g
/\/\/\s\@sync\signore\n.+,?/g
I wrote test files separated from the source code because I didn't see any test folder. I didn't find any reference in contributing guide.
Questions:
["windows", "linux", "mac", "darwin"]
. I think we should only use darwin instead of mac