Emit warning when user profile is in project files
This implements issue #890. It warns if a :user profile is found in either project.clj or a profiles.clj in the project directory.
This commit is contained in:
parent
fbc1804f86
commit
ec435b48a6
1 changed files with 10 additions and 1 deletions
|
@ -362,8 +362,16 @@
|
|||
|
||||
(alter-var-root #'warn-user-repos memoize)
|
||||
|
||||
(defn- warn-user-profile [profiles]
|
||||
(when (contains? profiles :user)
|
||||
(println "WARNING: user-level profile defined in project files.")))
|
||||
|
||||
(alter-var-root #'warn-user-profile memoize)
|
||||
|
||||
(defn- project-profiles [project]
|
||||
(utils/read-file (io/file (:root project) "profiles.clj")))
|
||||
(let [profiles (utils/read-file (io/file (:root project) "profiles.clj"))]
|
||||
(warn-user-profile profiles)
|
||||
profiles))
|
||||
|
||||
(defn- read-profiles
|
||||
"Read profiles from a variety of sources.
|
||||
|
@ -373,6 +381,7 @@
|
|||
project map."
|
||||
[project]
|
||||
(warn-user-repos)
|
||||
(warn-user-profile (:profiles project))
|
||||
(merge @default-profiles (user/profiles)
|
||||
(:profiles project) (project-profiles project)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue