-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conf file for repo locations #2
Conf file for repo locations #2
Conversation
Uses conf.json location for gcc repo
Contains locations for Github repo locations
Uses repo locations are specified in json.conf
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.
This looks really good!
Some thoughts:
-
Probably constants.clj can go away, since the conf can completely replace it.
-
Did you consider using a specialized configuration library instead of raw json? There are a lot of benefits, like explicitly handling multiple users, and multiple environments, like test vs development. See for example:
https://github.com/yogthos/config
https://github.com/grammarly/omniconf
https://github.com/levand/immuconf -
I saw you made a second pull request where you added the json library. Can you unify these two? Before I pull your changes I want to be able to run your code, but I can't if one won't work without the other.
src/atom_finder/constants.clj
Outdated
|
||
(def ag-path (expand-home "~/opt/src/the_silver_searcher")) | ||
(def gcc-path (expand-home (get conf-data :gcc-path))) | ||
(def gcc-repo (gitp/load-repo "Z:\\Github\\gcc")) |
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.
Z:\Github\gcc looks specific to your machine?
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.
Fixed!
test/atom_finder/atom_patch_test.clj
Outdated
@@ -19,7 +20,7 @@ | |||
))) | |||
|
|||
(deftest bugzilla-id-test | |||
(let [gcc-repo (gitp/load-repo (expand-home "~/opt/src/gcc")) | |||
(let [gcc-repo (gitp/load-repo (expand-home (get (json/read-str (slurp (resource-path "conf.json")):key-fn keyword) :gcc-path))) |
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.
Using conf values should be shorter/easier.
|
(2.1) As the json is now, a conf lookup is kinda clunk. It looks like: (2.2) Managing several people's conf files is kinda a hassle, your config settings are different than mine, are different than henry's, managing that ourselves is doable, but annoying, whereas external libraries often make that easier. (2.3) Building off (2.2) it's usually a really good idea to have a special config setting for test, dev (1-per-developer), and production. Test files can be small and lightweight and required, whereas dev can be big and heavy and optional, and prod can be whatever we need for real paper-worthy results. (1) What you propose is certainly ok, but I think once 2.1 is addressed, (3) Great, thanks! No problem, git is a huge headache for the first few dozen times you use it until you get the hang of it. Then it becomes awesome, but it's definitely big and scary regardless. |
…ectory with spaces.
Uses conf.json for the locations of the repos, instead of just using a default location.