Skip to content
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

[WIP] production modes #97

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[WIP] production modes #97

wants to merge 1 commit into from

Conversation

vemv
Copy link
Contributor

@vemv vemv commented Dec 8, 2019

Brief

Part of #70

QA plan

Author checklist

  • I have QAed the functionality
  • The PR has a reasonably reviewable size and a meaningful commit history
  • I have run the branch formatter and observed no new/significative warnings
  • The build passes
  • I have self-reviewed the PR prior to assignment
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)

Reviewer checklist

  • I have checked out this branch and reviewed it locally, running it
  • I have QAed the functionality
  • I have reviewed the PR
  • Additionally, I have code-reviewed iteratively the PR considering the following aspects in isolation:
    • Correctness
    • Robustness (red paths, failure handling etc)
    • Modular design
    • Test coverage
    • Spec coverage
    • Documentation
    • Security
    • Performance
    • Breaking API changes
    • Cross-compatibility (Clojure/ClojureScript)

@@ -1,3 +1,5 @@
verify: `:pre`s preserved after refactor
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!

@@ -109,6 +109,78 @@
args-with-proper-tag-hints (ensure-proper-type-hints clj? args)]
(apply list args-with-proper-tag-hints prepost body))))))

(defn add-checking-form [tails ret-spec clj?] ;; deserves a test now
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cover with tests

Particularly, for :pre / :post preservation (while we're there: fix #90)

:clj? clj?})
(let [analysis-result (process-name-and-tails {:tail (list [left])
:name nil
:checking? false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to true, stop parsing prepost, discard defn add-prepost, ensure sensible checking clauses are emitted for let

(are [x] (-> x meta :arglists first second meta :tag #?(:clj #{'Boolean `Boolean}
:cljs #{'js/Boolean}))

(are [x] (testing x
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also improve rest of are forms

args-check-form? (-> args-check-form count pos?)
;; XXX analyze symbols (specs), replace keys (?)
checking-form (when (or args-check-form?)
(cond-> [`checking {}] ;; XXX options
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"production mode" options must be implemented

(apply concat)
(vec))
args-check-form? (-> args-check-form count pos?)
;; XXX analyze symbols (specs), replace keys (?)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this comment refers to the utils.spec checking possible API, and its possible differences to s.def's metadata API)

@@ -3,6 +3,7 @@
(:require
#?(:clj [clojure.spec.alpha :as spec] :cljs [cljs.spec.alpha :as spec])
[clojure.walk :as walk]
[nedap.speced.def.impl.analysis :refer [process-name-and-tails]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defprotocol lacks macroexpansion coverage

@vemv vemv added the core label Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant