Skip to content

Add clj-kondo hooks for o/ruleset#38

Open
keychera wants to merge 3 commits intooakes:masterfrom
keychera:master
Open

Add clj-kondo hooks for o/ruleset#38
keychera wants to merge 3 commits intooakes:masterfrom
keychera:master

Conversation

@keychera
Copy link

Thank you for this great library. I plan to use this a more in the future so I made a clj-kondo hook to help lint my code.

With this hook, o/ruleset will have this the following linting properties

  1. binding declaration for new symbols in :what block.
  2. binding from :what block will be usable in :when and :then block
  3. binding for session and match symbol in :when and :then block
  4. binding for session symbol in :then-finally block (:then-finally block will have no access to match and bindings from :what block)
  5. warning for usage of session and match symbol in :what block

I tested this in my 3 game projects that uses odoyle rules and the rules_test.cljc in this project using calva and all o/ruleset has no lint warning. the lsp feature like renaming and references work as expected as well. I also have confirmed the clj-kondo.exports is working correctly (in calva) by using this library as a git-deps of my fork. deps value below for convenience.

io.github.keychera/odoyle-rules {:git/sha "10447b7d8e3c9611fc9d59bc29d5a6d148d10556"}

There maybe edge cases that I haven't found so I am also gonna ask around for feedback with any other clojurians that uses this library.

related issue: #22

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant