Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
273017f0
Commit
273017f0
authored
10 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
remove commented-out code
parent
3cf3633a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/api/common/internal.clj
+0
-59
0 additions, 59 deletions
src/metabase/api/common/internal.clj
with
0 additions
and
59 deletions
src/metabase/api/common/internal.clj
+
0
−
59
View file @
273017f0
...
...
@@ -149,65 +149,6 @@
;;; ## ARG ANNOTATION FUNCTIONALITY
;;; ### Args Form Deannotation
;; (defn deannotate-arg
;; "If FORM is a symbol, strip off any annotations.
;; (deannotate-arg 'password.required) -> password"
;; [form]
;; (if-not (symbol? form) form
;; (let [[arg & _] (clojure.string/split (name form) #"\.")]
;; (symbol arg))))
;; (defn deannotate-args-form
;; "Walk ARGS-FORM and strip off any annotations.
;; (deannotate-args-form [id :as {{:keys [password.required old_password.required]} :body}])
;; -> [id :as {{:keys [password old_password]} :body}]"
;; [args-form]
;; (if (= args-form []) '[:as _]
;; (->> args-form
;; (mapv (partial clojure.walk/prewalk deannotate-arg)))))
;;; ### Args Form Annotation Gathering
;; (defn args-form->symbols
;; "Recursively walk ARGS-FORM and return a sequence of symbols.
;; (args-form->symbols [id :as {{:keys [password.required old_password.required]} :body}])
;; -> (id password.required old_password.required)"
;; [args-form]
;; {:post [(sequential? %)
;; (every? symbol? %)]}
;; (cond
;; (symbol? args-form) [args-form]
;; (map? args-form) (->> args-form
;; (mapcat (fn [[k v]]
;; [(args-form->symbols k) (args-form->symbols v)]))
;; (mapcat args-form->symbols))
;; (sequential? args-form) (mapcat args-form->symbols
;; args-form)
;; :else []))
;; (defn symb->arg+annotations
;; "Return a sequence of pairs of `[annotation-kw deannotated-arg-symb]` for an annotated ARG.
;; (symb->arg+annotations 'password) -> nil
;; (symb->arg+annotations 'password.required) -> [[:required password]]
;; (symb->arg+annotations 'password.required.str) -> [[:required password], [:str password]]"
;; [arg]
;; {:pre [(symbol? arg)]}
;; (let [[arg & annotations] (clojure.string/split (name arg) #"\.")]
;; (when (seq annotations)
;; (->> annotations
;; (map (fn [annotation]
;; [(keyword annotation) (symbol arg)]))))))
;;; ### let-annotated-args
(
defn
arg-annotation-let-binding
"Return a pair like `[arg-symb arg-annotation-form]`, where `arg-annotation-form` is the result of calling the `arg-annotation-fn` implementation
for ANNOTATION-KW."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment