Replies: 8 comments 12 replies
-
Topic: Edn hook registration An edn hook will be registered in clj-kondo config. |
Beta Was this translation helpful? Give feedback.
-
Topic: Edn hook activation How will clj-kondo know if an edn hook should lint an edn file? Initial ideas:
Other thoughts:
|
Beta Was this translation helpful? Give feedback.
-
Topic: use case: cljdoc.edn Exploring specific real-world edn files and what linting they might benefit from is interesting. The cljdoc.edn file characteristics of interest:
|
Beta Was this translation helpful? Give feedback.
-
Topic: use case: kaocha tests.edn Characteristics of interest:
|
Beta Was this translation helpful? Give feedback.
-
Topic: Export/Import edn hook support Current clj-kondo hooks can be exported by library authors to the benefit of folks using those libraries.
|
Beta Was this translation helpful? Give feedback.
-
Topic: The hooks API The current hooks API offers support for working with rewrite-clj nodes, looking up analysis data, and registering findings. As we explore and experiment, we'll likely find some new API functions that are needed, and others that are not absolutely needed, but helpful when working to lint edn files. We'll have to add what is needed, but should probably be conservative, at least initially, in adding in nice-to-haves. |
Beta Was this translation helpful? Give feedback.
-
Tangential but related: reporting In some cases, like
Here's the same in a format for custom stand-alone cljdoc.edn validator I was experimenting with recently:
One could argue,
|
Beta Was this translation helpful? Give feedback.
-
Now having read the above, I think a config like: {:hooks {:edn-file [{:name :cljdoc.edn :file-regex "..." :fn org.cljdoc/config-hook}]}} would work. We'll have to figure out if regexes work well with Windows file paths too, but regexes are already used with An .edn file will be matched against any of these regexes, and then the corresponding The hook will see a map with Additionally, for custom rules, a library has to export for default settings of their custom rules. {:linters {:cljdoc/cljdoc.edn-missing-foobar {:level :warning}
:cljdoc/cljdoc.edn-consistent-quux {:level :warning}} This is already the case with the other hooks as well. Hooks do not have access to the file system and I don't see a need for that to change for this specific feature. |
Beta Was this translation helpful? Give feedback.
-
A place to discuss, flesh out, then scope #1392
All ideas presented are just that, critique, corrections and brainstorming are most welcome!
Beta Was this translation helpful? Give feedback.
All reactions