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
9a2d06e5
Commit
9a2d06e5
authored
2 years ago
by
Braden Shepherdson
Committed by
Braden Shepherdson
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve clj-kondo linting of with-temp*
parent
78f2799b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.clj-kondo/config.edn
+2
-2
2 additions, 2 deletions
.clj-kondo/config.edn
.clj-kondo/hooks/toucan/util/test.clj
+17
-7
17 additions, 7 deletions
.clj-kondo/hooks/toucan/util/test.clj
with
19 additions
and
9 deletions
.clj-kondo/config.edn
+
2
−
2
View file @
9a2d06e5
...
...
@@ -16,8 +16,6 @@
(
clojure.core.logic/matcha
)
(
clojure.core.logic/run
)
(
clojure.test/is
[
query=
sql=
partial=
])
(
toucan.util.test/with-temp*
)
(
metabase.test/with-temp*
)
(
taoensso.nippy/extend-freeze
)
(
taoensso.nippy/extend-thaw
)
(
metabase.driver.druid.query-processor-test/druid-query-returning-rows
)
...
...
@@ -396,6 +394,8 @@
metabase.test/query
hooks.metabase.test.data/$ids
metabase.test/run-mbql-query
hooks.metabase.test.data/$ids
metabase.test/with-temp
hooks.toucan.util.test/with-temp
metabase.test/with-temp*
hooks.toucan.util.test/with-temp*
metabase-enterprise.serialization.test-util/with-temp-dpc
hooks.toucan.util.test/with-temp*
metabase.test/with-temporary-setting-values
hooks.metabase.test.util/with-temporary-setting-values
metabase.test.data/$ids
hooks.metabase.test.data/$ids
metabase.test.data/dataset
hooks.metabase.test.data/dataset
...
...
This diff is collapsed.
Click to expand it.
.clj-kondo/hooks/toucan/util/test.clj
+
17
−
7
View file @
9a2d06e5
(
ns
hooks.toucan.util.test
(
:require
[
clj-kondo.hooks-api
:as
api
]))
(
defn-
with-temp-inner
[
body
bindings
]
(
let
[
pairs
(
partition
2
bindings
)
db-refs
(
map
first
pairs
)
let-stream
(
for
[[
_
binding+opts
]
pairs
part
(
:children
binding+opts
)]
part
)]
(
api/vector-node
[(
api/vector-node
db-refs
)
(
api/list-node
(
list*
(
api/token-node
`
let
)
(
api/vector-node
let-stream
)
body
))])))
(
defn
with-temp
[{
:keys
[
node
]}]
(
let
[[
_
db-ref
binding+opts
&
body
]
(
:children
node
)
[
args
opts
]
(
:children
binding+opts
)]
{
:node
(
api/vector-node
[
db-ref
opts
(
api/list-node
(
list*
(
api/token-node
'fn
)
(
api/vector-node
[
args
])
body
))])}))
(
let
[[
_
db-ref
binding+opts
&
body
]
(
:children
node
)]
{
:node
(
with-temp-inner
body
[
db-ref
binding+opts
])}))
(
defn
with-temp*
[{
:keys
[
node
]}]
(
let
[[
_
bindings
&
body
]
(
:children
node
)]
{
:node
(
with-temp-inner
body
(
:children
bindings
))}))
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