-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Greater dir naming flexibility. #245
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DO NOT IMPLEMENT (discussion only):
Could head this off by following the idiom as for $PROJECT_HOME set PROJECT_NAME to 'edx-platform' if not set (e.g. after line 120).
It would not be a bad habit to get out of hardwiring constants like this anyway (.virtualenv comes to mind).
The downside (for a PROJECT_NAME) is that would be 21 more lines to change, for dubious benefit (there is clear purpose for PROJECT_HOME).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For rvm (and probably also virtualenv), I'm not sure it's worth not hardcoding the name. People can still make and switch to other ones, and I can't imagine that they have a -different- virtualenv that has something else entirely but is named edx-platform.
On the other hand, I do think it might be a good idea to have something as simple as PROJECT_NAME=edx-platform along with all the other constant defs, since we do use it in a couple of different places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(continuing discussion only) - re: hardcoding: first: taking out literal values tends to immune your code from changes over time (e.g. .virtualenv was the default from virtualenvwrapper, but now is Envs).
The second (more significant) benefit: your setup code (at least snippets) will prove more portable, more easily adapted / modified to other sub-projects as they spring up for several reasons: [1] one (as opposed to many) thing to change (e.g. PROJECT_NAME), and [2] the entire idiom of get something from a variable encourages coding so as to "not make assumptions" [e.g. "what is the "name"?", "what are the parameters it needs?", etc.].
Of course, all that needs be weighed against obfuscation: clearer (simpler) is better. In the case of PROJECT_NAME, if I were starting from scratch, that would be a wash for me (could go either way); PROJECT_HOME is more concrete in motivation. Anyway, that's how I think about it. YMMV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I don't think PROJECT_NAME is really worth it, but the (your) PROJECT_HOME change definitely was.