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

False positive on clojure spec? #227

Closed
didibus opened this Issue Aug 24, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@didibus
Copy link

didibus commented Aug 24, 2017

There's some issues I think with Clojure spec:

:linter :suspicious-expression, :msg "and called with 1 args. (and x) always returns x. Perhaps there are misplaced parentheses?"

for

(s/def :a/b (s/map-of :a/c (s/or :d? :a/b :string? string?)))

AND

:linter :constant-test, :msg "Test expression is always logical true or always logical false: 1 in form (if or__4469__auto__ or__4469__auto__ (clojure.core/or 0))"

for

(s/def :a/bb (s/map-of :a/cc :a/dd :min-count 1 :max-count 200 :distinct true))

@jafingerhut

This comment has been minimized.

Copy link
Collaborator

jafingerhut commented Aug 24, 2017

Thanks for the report. I have not yet done any investigation into Clojure spec and how it interacts with Eastwood warnings, and I'm not aware of anyone else who has. Not sure when/if it will be investigated.

@carocad

This comment has been minimized.

Copy link
Contributor

carocad commented Aug 31, 2017

I am also having this issue. I have had to exclude the spec namespaces from being analyzed, otherwise eastwood reports an error on every compilation.

I check the code that was causing the problem and I am almost sure that the error is in clojure.spec. As you see from the expanded code, the spec macros dont fully resolve all conditions at compile time, leaving things like or and and to be evaluated in runtime even though the value is clear before hand as eastwood correctly reports.

I raised this topic once in the slack channel but didnt get much feedback on it. Probably because it was on the very early stage on Spec.

Hope it helps

@jafingerhut

This comment has been minimized.

Copy link
Collaborator

jafingerhut commented Aug 31, 2017

It is reasonably common for macros to generate code in a way that a person would not write. Because Eastwood expands macros before analyzing the code, it can generate warnings about these things.

Some Eastwood internal code has the ability to disable such warnings when they are caused by the expansion of particular macros. For example, see this Eastwood source file: https://github.com/jonase/eastwood/blob/master/resource/eastwood/config/clojure.clj

or the other ones in this directory: https://github.com/jonase/eastwood/tree/master/resource/eastwood/config

It requires a bit of examination of the macro-expanded code to get a "filter" that minimizes the disabling of warnings possible -- too much and you might be risking disabling warnings about developer-written code included in the macro expansions. I haven't tried to do that yet for clojure.spec macros, but if someone is interested in trying to create a 'filter' like the existing ones, and thinks they have found one that avoids at least the noisiest of false positive warnings, we can consider adding it to Eastwood.

@danielcompton

This comment has been minimized.

Copy link
Contributor

danielcompton commented Sep 6, 2017

This could probably be tightened up a little bit, but it removes the warnings for me:

(disable-warning
  {:linter                      :suspicious-expression
   :for-macro                   'clojure.core/and
   :if-inside-macroexpansion-of #{'clojure.spec/every 'clojure.spec.alpha/every
                                  'clojure.spec/and 'clojure.spec.alpha/and}
   :within-depth                6
   :reason                      "Spec's macros generate one or more expressions for the and."})
@jafingerhut

This comment has been minimized.

Copy link
Collaborator

jafingerhut commented Sep 6, 2017

@danielcompton Thanks for that. Do you happen to know of an open source Clojure project that has one of these false positive warnings without your extra filter, and your filter eliminates the warning?

@danielcompton

This comment has been minimized.

Copy link
Contributor

danielcompton commented Sep 6, 2017

I don't have an open source one, but these are what was triggering the warning:

(ns test-project.core
  (:require [clojure.spec :as s]
    [clojure.string :as str]))

(s/def :auth/roles (s/every keyword? :kind set?))

(def empty-map (s/and (s/keys) empty?))
@danielcompton

This comment has been minimized.

Copy link
Contributor

danielcompton commented Sep 6, 2017

Here's a sample project:

eastwood-spec.zip

$ lein eastwood "{:config-files [\"./eastwood.clj\"]}"
# vs
$ lein eastwood
@danielcompton

This comment has been minimized.

Copy link
Contributor

danielcompton commented Sep 6, 2017

Even within-depth 1 works to eliminate the warnings:

(disable-warning
  {:linter                      :suspicious-expression
   :for-macro                   'clojure.core/and
   :if-inside-macroexpansion-of #{'clojure.spec/every 'clojure.spec.alpha/every
                                  'clojure.spec/and 'clojure.spec.alpha/and}
   :within-depth                1
   :reason                      "Spec's macros generate one or more expressions for the and."})

EDIT: my actual project needed 6 (but maybe less).

@jafingerhut

This comment has been minimized.

Copy link
Collaborator

jafingerhut commented Oct 10, 2017

The commit linked above adds the filter developed by @danielcompton to the default list of filters installed within Eastwood. It should be in the next release. Thanks, Daniel!

@carocad

This comment has been minimized.

Copy link
Contributor

carocad commented Jan 17, 2018

@jafingerhut I am still having this issue even though I am using eastwood 0.2.5.

Some extra info

hope it helps

@slipset

This comment has been minimized.

Copy link
Collaborator

slipset commented Jan 25, 2018

s/keys with only opt-un seems to break as well:

(macroexpand '(s/keys :opt-un [::created-by ::createdByName ::createdByEmail]))
;; => (clojure.spec.alpha/map-spec-impl
 {:req-un 'nil,
  :opt-un
  '[:ardoq.specs/created-by
    :ardoq.specs/createdByName
    :ardoq.specs/createdByEmail],
  :gfn nil,
  :pred-exprs [(fn* [G__163116] (clojure.core/map? G__163116))],
  :keys-pred
  (fn* [G__163116] (clojure.core/and (clojure.core/map? G__163116))),
  :opt-keys '[:created-by :createdByName :createdByEmail],
  :req-specs '[],
  :req 'nil,
  :req-keys '[],
  :opt-specs
  '[:ardoq.specs/created-by
    :ardoq.specs/createdByName
    :ardoq.specs/createdByEmail],
  :pred-forms '[(clojure.core/fn [%] (clojure.core/map? %))],
  :opt 'nil})
(disable-warning
  {:linter                      :suspicious-expression
   :for-macro                   'clojure.core/and
   :if-inside-macroexpansion-of #{'clojure.spec/every 'clojure.spec.alpha/every
                                  'clojure.spec/and 'clojure.spec.alpha/and
                                  'clojure.spec/keys 'clojure.spec.alpha/keys
                                  }
   :within-depth                3
   :reason                      "Spec's macros generate one or more expressions for the and."})

solves it.

tangrammer added a commit to akvo/akvo-lumen that referenced this issue Jun 26, 2018

Squashed commit of the following:
commit d46b712
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Mon Jun 25 16:42:33 2018 +0200

    WIP 6

commit 9f939c0
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Fri Jun 22 13:20:54 2018 +0200

    WIP 5 [skip ci]

commit f45b979
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Thu Jun 21 10:03:32 2018 +0200

    WIP 4 [skip ci]

commit a80a51a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:25:58 2018 +0200

    WIP 3

commit f615ec5
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:12:57 2018 +0200

    WIP 2

commit 5f590c3
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 14:06:13 2018 +0200

    WIP

commit 8f21c01
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:35:02 2018 +0200

    Add transformation specs (using s/multi-spec)

commit 55512f8
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:21:17 2018 +0200

    Ignore clojure.spec.alpha/keys in eastwood linting [skip ci]

    Relates to "False positive on clojure spec?"
    jonase/eastwood#227

    https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

commit 8e10807
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:13:16 2018 +0200

    Keywordizing maps so could be spec(ified) later

    Also remove indirection visualisation -> visualisation-impl

commit dc7844a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:49:13 2018 +0200

    Add aggregation specs and update related tests

commit 98bfe34
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:46:51 2018 +0200

    Keywordize aggregation payloads to be spec(ified)

commit 4b7f0cd
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 27 01:17:56 2018 +0200

    Unify a.l.specs.transformations ns aliasing

commit 08c093a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 26 13:41:25 2018 +0200

    Add aggregation specs

    using s/multi-spec https://clojure.org/guides/spec#_multi_spec

    Use keywords in aggregation internal impl ... so we can spec them

    Add a.l.specs/dataset and update a.l.specs.transformations accordingly

    Add a.l.aggregation.utils specs

    Add a.l.aggregation.filter specs

    Unify spec namespace patterns

    a.l.l.aggregation.pivot specs

    Use potemkin#import-vars to define all specs import in one place

    Remove unused function load-columns

    Adding specs to bar, line, pie and scatter aggregation types

tangrammer added a commit to akvo/akvo-lumen that referenced this issue Jun 27, 2018

Squash initial branch
Keywordize transformation args (to be spec later)

Spec instrumentatino disabled temporary

Add :transformation/command s/multi-spec

Based on ::transformation/type value

Add s/multi-spec based on ::transformation.engine/op

Add s/multi-spec defmethod op-spec-type "core/change-datatype"

Add s/multi-spec defmethod op-spec-type "core/combine"

Add s/multi-spec defmethod op-spec-type "core/delete-column"

Add s/multi-spec defmethod op-spec-type "core/derive"

Add s/multi-spec defmethod op-spec-type "core/filter-column"

Add s/multi-spec defmethod op-spec-type "core/generate-geopoints"

Fix fully keywordize transformation ::op

Ignore clojure.spec.alpha/keys in eastwood linting

Relates to "False positive on clojure spec?"
jonase/eastwood#227

https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

Add s/multi-spec defmethod op-spec-type  "core/remove-sort"

and "core/sort-column"

Add Add s/multi-spec defmethod op-spec-type  "core/rename-column"

Add Add s/multi-spec defmethod op-spec-type  "core/reverse-geocode"

Add Add s/multi-spec defmethod op-spec-type "core/to-lowercase"

"core/to-uppercase" "core/to-titlecase" "core/trim" "core/trim-doublespace"

Add Add s/multi-spec defmethod op-spec-type "core/merge-dataset"

Also keywordize merge-datasets args

Revert public visibility of a.l.l.visualistion.maps functions

Refactor

Squashed commit of the following:

commit d46b712
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Mon Jun 25 16:42:33 2018 +0200

    WIP 6

commit 9f939c0
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Fri Jun 22 13:20:54 2018 +0200

    WIP 5 [skip ci]

commit f45b979
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Thu Jun 21 10:03:32 2018 +0200

    WIP 4 [skip ci]

commit a80a51a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:25:58 2018 +0200

    WIP 3

commit f615ec5
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:12:57 2018 +0200

    WIP 2

commit 5f590c3
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 14:06:13 2018 +0200

    WIP

commit 8f21c01
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:35:02 2018 +0200

    Add transformation specs (using s/multi-spec)

commit 55512f8
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:21:17 2018 +0200

    Ignore clojure.spec.alpha/keys in eastwood linting [skip ci]

    Relates to "False positive on clojure spec?"
    jonase/eastwood#227

    https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

commit 8e10807
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:13:16 2018 +0200

    Keywordizing maps so could be spec(ified) later

    Also remove indirection visualisation -> visualisation-impl

commit dc7844a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:49:13 2018 +0200

    Add aggregation specs and update related tests

commit 98bfe34
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:46:51 2018 +0200

    Keywordize aggregation payloads to be spec(ified)

commit 4b7f0cd
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 27 01:17:56 2018 +0200

    Unify a.l.specs.transformations ns aliasing

commit 08c093a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 26 13:41:25 2018 +0200

    Add aggregation specs

    using s/multi-spec https://clojure.org/guides/spec#_multi_spec

    Use keywords in aggregation internal impl ... so we can spec them

    Add a.l.specs/dataset and update a.l.specs.transformations accordingly

    Add a.l.aggregation.utils specs

    Add a.l.aggregation.filter specs

    Unify spec namespace patterns

    a.l.l.aggregation.pivot specs

    Use potemkin#import-vars to define all specs import in one place

    Remove unused function load-columns

    Adding specs to bar, line, pie and scatter aggregation types

tangrammer added a commit to akvo/akvo-lumen that referenced this issue Jun 28, 2018

Squash initial branch
Keywordize transformation args (to be spec later)

Spec instrumentatino disabled temporary

Add :transformation/command s/multi-spec

Based on ::transformation/type value

Add s/multi-spec based on ::transformation.engine/op

Add s/multi-spec defmethod op-spec-type "core/change-datatype"

Add s/multi-spec defmethod op-spec-type "core/combine"

Add s/multi-spec defmethod op-spec-type "core/delete-column"

Add s/multi-spec defmethod op-spec-type "core/derive"

Add s/multi-spec defmethod op-spec-type "core/filter-column"

Add s/multi-spec defmethod op-spec-type "core/generate-geopoints"

Fix fully keywordize transformation ::op

Ignore clojure.spec.alpha/keys in eastwood linting

Relates to "False positive on clojure spec?"
jonase/eastwood#227

https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

Add s/multi-spec defmethod op-spec-type  "core/remove-sort"

and "core/sort-column"

Add Add s/multi-spec defmethod op-spec-type  "core/rename-column"

Add Add s/multi-spec defmethod op-spec-type  "core/reverse-geocode"

Add Add s/multi-spec defmethod op-spec-type "core/to-lowercase"

"core/to-uppercase" "core/to-titlecase" "core/trim" "core/trim-doublespace"

Add Add s/multi-spec defmethod op-spec-type "core/merge-dataset"

Also keywordize merge-datasets args

Revert public visibility of a.l.l.visualistion.maps functions

Refactor

Squashed commit of the following:

commit d46b712
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Mon Jun 25 16:42:33 2018 +0200

    WIP 6

commit 9f939c0
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Fri Jun 22 13:20:54 2018 +0200

    WIP 5 [skip ci]

commit f45b979
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Thu Jun 21 10:03:32 2018 +0200

    WIP 4 [skip ci]

commit a80a51a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:25:58 2018 +0200

    WIP 3

commit f615ec5
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:12:57 2018 +0200

    WIP 2

commit 5f590c3
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 14:06:13 2018 +0200

    WIP

commit 8f21c01
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:35:02 2018 +0200

    Add transformation specs (using s/multi-spec)

commit 55512f8
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:21:17 2018 +0200

    Ignore clojure.spec.alpha/keys in eastwood linting [skip ci]

    Relates to "False positive on clojure spec?"
    jonase/eastwood#227

    https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

commit 8e10807
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:13:16 2018 +0200

    Keywordizing maps so could be spec(ified) later

    Also remove indirection visualisation -> visualisation-impl

commit dc7844a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:49:13 2018 +0200

    Add aggregation specs and update related tests

commit 98bfe34
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:46:51 2018 +0200

    Keywordize aggregation payloads to be spec(ified)

commit 4b7f0cd
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 27 01:17:56 2018 +0200

    Unify a.l.specs.transformations ns aliasing

commit 08c093a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 26 13:41:25 2018 +0200

    Add aggregation specs

    using s/multi-spec https://clojure.org/guides/spec#_multi_spec

    Use keywords in aggregation internal impl ... so we can spec them

    Add a.l.specs/dataset and update a.l.specs.transformations accordingly

    Add a.l.aggregation.utils specs

    Add a.l.aggregation.filter specs

    Unify spec namespace patterns

    a.l.l.aggregation.pivot specs

    Use potemkin#import-vars to define all specs import in one place

    Remove unused function load-columns

    Adding specs to bar, line, pie and scatter aggregation types

tangrammer added a commit to akvo/akvo-lumen that referenced this issue Jun 28, 2018

Squash initial branch
Keywordize transformation args (to be spec later)

Spec instrumentatino disabled temporary

Add :transformation/command s/multi-spec

Based on ::transformation/type value

Add s/multi-spec based on ::transformation.engine/op

Add s/multi-spec defmethod op-spec-type "core/change-datatype"

Add s/multi-spec defmethod op-spec-type "core/combine"

Add s/multi-spec defmethod op-spec-type "core/delete-column"

Add s/multi-spec defmethod op-spec-type "core/derive"

Add s/multi-spec defmethod op-spec-type "core/filter-column"

Add s/multi-spec defmethod op-spec-type "core/generate-geopoints"

Fix fully keywordize transformation ::op

Ignore clojure.spec.alpha/keys in eastwood linting

Relates to "False positive on clojure spec?"
jonase/eastwood#227

https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

Add s/multi-spec defmethod op-spec-type  "core/remove-sort"

and "core/sort-column"

Add Add s/multi-spec defmethod op-spec-type  "core/rename-column"

Add Add s/multi-spec defmethod op-spec-type  "core/reverse-geocode"

Add Add s/multi-spec defmethod op-spec-type "core/to-lowercase"

"core/to-uppercase" "core/to-titlecase" "core/trim" "core/trim-doublespace"

Add Add s/multi-spec defmethod op-spec-type "core/merge-dataset"

Also keywordize merge-datasets args

Revert public visibility of a.l.l.visualistion.maps functions

Refactor

Squashed commit of the following:

commit d46b712
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Mon Jun 25 16:42:33 2018 +0200

    WIP 6

commit 9f939c0
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Fri Jun 22 13:20:54 2018 +0200

    WIP 5 [skip ci]

commit f45b979
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Thu Jun 21 10:03:32 2018 +0200

    WIP 4 [skip ci]

commit a80a51a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:25:58 2018 +0200

    WIP 3

commit f615ec5
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:12:57 2018 +0200

    WIP 2

commit 5f590c3
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 14:06:13 2018 +0200

    WIP

commit 8f21c01
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:35:02 2018 +0200

    Add transformation specs (using s/multi-spec)

commit 55512f8
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:21:17 2018 +0200

    Ignore clojure.spec.alpha/keys in eastwood linting [skip ci]

    Relates to "False positive on clojure spec?"
    jonase/eastwood#227

    https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

commit 8e10807
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:13:16 2018 +0200

    Keywordizing maps so could be spec(ified) later

    Also remove indirection visualisation -> visualisation-impl

commit dc7844a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:49:13 2018 +0200

    Add aggregation specs and update related tests

commit 98bfe34
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:46:51 2018 +0200

    Keywordize aggregation payloads to be spec(ified)

commit 4b7f0cd
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 27 01:17:56 2018 +0200

    Unify a.l.specs.transformations ns aliasing

commit 08c093a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 26 13:41:25 2018 +0200

    Add aggregation specs

    using s/multi-spec https://clojure.org/guides/spec#_multi_spec

    Use keywords in aggregation internal impl ... so we can spec them

    Add a.l.specs/dataset and update a.l.specs.transformations accordingly

    Add a.l.aggregation.utils specs

    Add a.l.aggregation.filter specs

    Unify spec namespace patterns

    a.l.l.aggregation.pivot specs

    Use potemkin#import-vars to define all specs import in one place

    Remove unused function load-columns

    Adding specs to bar, line, pie and scatter aggregation types

tangrammer added a commit to akvo/akvo-lumen that referenced this issue Jun 29, 2018

Add transformation && visualisation domain specs (based on operation)
Squash initial branch

Keywordize transformation args (to be spec later)

Spec instrumentatino disabled temporary

Add :transformation/command s/multi-spec

Based on ::transformation/type value

Add s/multi-spec based on ::transformation.engine/op

Add s/multi-spec defmethod op-spec-type "core/change-datatype"

Add s/multi-spec defmethod op-spec-type "core/combine"

Add s/multi-spec defmethod op-spec-type "core/delete-column"

Add s/multi-spec defmethod op-spec-type "core/derive"

Add s/multi-spec defmethod op-spec-type "core/filter-column"

Add s/multi-spec defmethod op-spec-type "core/generate-geopoints"

Fix fully keywordize transformation ::op

Ignore clojure.spec.alpha/keys in eastwood linting

Relates to "False positive on clojure spec?"
jonase/eastwood#227

https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

Add s/multi-spec defmethod op-spec-type  "core/remove-sort"

and "core/sort-column"

Add Add s/multi-spec defmethod op-spec-type  "core/rename-column"

Add Add s/multi-spec defmethod op-spec-type  "core/reverse-geocode"

Add Add s/multi-spec defmethod op-spec-type "core/to-lowercase"

"core/to-uppercase" "core/to-titlecase" "core/trim" "core/trim-doublespace"

Add Add s/multi-spec defmethod op-spec-type "core/merge-dataset"

Also keywordize merge-datasets args

Revert public visibility of a.l.l.visualistion.maps functions

Refactor

Squashed commit of the following:

commit d46b712
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Mon Jun 25 16:42:33 2018 +0200

    WIP 6

commit 9f939c0
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Fri Jun 22 13:20:54 2018 +0200

    WIP 5 [skip ci]

commit f45b979
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Thu Jun 21 10:03:32 2018 +0200

    WIP 4 [skip ci]

commit a80a51a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:25:58 2018 +0200

    WIP 3

commit f615ec5
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 18:12:57 2018 +0200

    WIP 2

commit 5f590c3
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 14:06:13 2018 +0200

    WIP

commit 8f21c01
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:35:02 2018 +0200

    Add transformation specs (using s/multi-spec)

commit 55512f8
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:21:17 2018 +0200

    Ignore clojure.spec.alpha/keys in eastwood linting [skip ci]

    Relates to "False positive on clojure spec?"
    jonase/eastwood#227

    https://github.com/jonase/eastwood/blob/2235d8b4d5da8ccc9ec47a96257eee05b9f25c00/resource/eastwood/config/clojure.clj

commit 8e10807
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 20 10:13:16 2018 +0200

    Keywordizing maps so could be spec(ified) later

    Also remove indirection visualisation -> visualisation-impl

commit dc7844a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:49:13 2018 +0200

    Add aggregation specs and update related tests

commit 98bfe34
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 19 10:46:51 2018 +0200

    Keywordize aggregation payloads to be spec(ified)

commit 4b7f0cd
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Wed Jun 27 01:17:56 2018 +0200

    Unify a.l.specs.transformations ns aliasing

commit 08c093a
Author: Juan A. Ruz <juanantonioruz@gmail.com>
Date:   Tue Jun 26 13:41:25 2018 +0200

    Add aggregation specs

    using s/multi-spec https://clojure.org/guides/spec#_multi_spec

    Use keywords in aggregation internal impl ... so we can spec them

    Add a.l.specs/dataset and update a.l.specs.transformations accordingly

    Add a.l.aggregation.utils specs

    Add a.l.aggregation.filter specs

    Unify spec namespace patterns

    a.l.l.aggregation.pivot specs

    Use potemkin#import-vars to define all specs import in one place

    Remove unused function load-columns

    Adding specs to bar, line, pie and scatter aggregation types

Fix rebase

Refactor

Fix data to conform specs

Adapt FE transformationlog to specs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment