clj-kondo

https://github.com/clj-kondo/clj-kondo
reefersleep 2020-06-29T06:25:55.079200Z

Hello @borkdude 🙂 I am trying out super-linter with

VALIDATE_ALL_CODEBASE: false
          VALIDATE_CLOJURE: true
, and, curiously, it seems to pick up and validate e.g. YAML and JSON files are validated. That’s one issue; I thought that, according to the super-linter docs, once you turn on a specific validator, you turn off the rest. It’s not my real issue, though. My real problem is the following:
File:[project/src/my_ns.clj]
  - WARN! Failed to get filetype for:[project/src/my_ns.clj]!

reefersleep 2020-06-29T06:26:12.079600Z

Have you seen anything like that before?

reefersleep 2020-06-29T06:27:12.080700Z

I wanted to ask at the #super-linter channel on whatever medium, but there is none linked at the super-linter github repo.

reefersleep 2020-06-29T06:28:12.081800Z

So, sorry to bother you about what I guess is essentially not a problem with clj-kondo 😅 Just thought you might have some input regardless.

eskos 2020-06-29T06:53:43.083Z

super-linter is GitHub’s native tool (the repo is owned by GitHub itself, in case you missed that) so you probably should ask through the repo’s Issues about that one.

reefersleep 2020-06-29T08:02:19.086100Z

Thanks @suomi.esko. I thought it’d be a bit much to ask via something like Issues when I had no clue whether there was an error in the code or an error in my thinking. Maybe this is customary, though? I tend to ask more informally first, like in Slack 🙂

borkdude 2020-06-29T08:03:03.086300Z

That's fine

reefersleep 2020-06-29T08:03:54.086500Z

Which one? Asking in Issues when I don’t know if the Issue is actually with the code? 🙂

borkdude 2020-06-29T08:04:30.086700Z

Asking everywhere is fine with me. But super-linter is so new that you probably have the most luck at the repo itself

👍 1
borkdude 2020-06-29T07:58:41.083800Z

@reefersleep Yes, like @suomi.esko, it's probably best if you post an issue there. Do you know which version you are running? The version with clj-kondo in it might not be published yet, it came after 2.2.0

reefersleep 2020-06-29T08:00:41.085400Z

@borkdude I don’t understand that; the version I tried was 2.2.0, the documentation mentioned Clojure at that point. In any case, I bumped it to 2.2.2, and that didn’t work either. A colleague of mine pointed out the error in the lib/linter.sh script, and I opened up a PR which hopefully fixes the problem: https://github.com/github/super-linter/pull/300/files

borkdude 2020-06-29T08:01:16.085800Z

2.2.2 was a typo, I meant 2.2.0, I don't think there is a newer published version yet

borkdude 2020-06-29T08:01:37.086Z

cool!

slimslenderslacks 2020-06-29T15:02:26.093300Z

@reefersleep speaking of super-linter, the company I'm at is also going to provide similar support for running clj-kondo. If you're interested in trying it, it's available at https://go.atomist.com/catalog/skills/atomist/clj-kondo-skill (also requires that you install a GitHub app). We're focusing on enabling tools to run on events, and then push data back to be evaluated by other functions. Ultimately, we're working towards being able to say things like "IF clj-kondo had no violations, AND the security check passed, AND the unit tests succeeded, THEN ...). IFTTT for delivery so to speak

🤓 2
borkdude 2020-06-29T15:05:59.095100Z

Looks interesting

slimslenderslacks 2020-06-29T15:06:17.095600Z

@borkdude one of the things I've been excited about is the possibility of potentially sharing configurations across Repos.

borkdude 2020-06-29T15:06:36.095900Z

Feel free to submit to the docs once you're ready. Maybe https://github.com/borkdude/clj-kondo/blob/master/doc/ci-integration.md is a good place for it

borkdude 2020-06-29T15:07:18.097100Z

@slimslenderslacks That's cool. Can you also share code files that are necessary for hooks (which is a new feature)?

slimslenderslacks 2020-06-29T15:09:30.099Z

Will do, thanks! The code that we run is here: https://github.com/atomist-skills/clj-kondo-skill/blob/master/src/atomist/main.cljs. I actually had not thought about hooks but these things have parameters (https://github.com/atomist-skills/clj-kondo-skill/blob/master/skill.edn#L28) so probably could look at ways to share hooks too. That's really interesting.

slimslenderslacks 2020-06-29T15:10:50.100900Z

The first thing that interested me was using public urls (e.g gist urls) to share configurations between teams. Among our own clojure repos, that certainly helps us.

slimslenderslacks 2020-06-29T15:13:12.102600Z

And that kind of sharing was easy to add. It seems to me like there could be value in sharing libraries of linter rules anyway. I'll take a look at hooks as well.

borkdude 2020-06-29T15:14:08.102900Z

These are some examples: https://github.com/borkdude/clj-kondo/tree/master/libraries

slimslenderslacks 2020-06-29T15:29:45.103Z

Right! So one of the things we've added is the ability to reference a config by url. So, for slingshot, we could pull in <https://raw.githubusercontent.com/borkdude/clj-kondo/a46f9ecb8128e8359cb410ebafe661ca0f58fe17/libraries/slingshot/.clj-kondo/config.edn#> for all projects that have slingshot in the CP.

slimslenderslacks 2020-06-29T15:31:33.103200Z

I don't have an instinct for how practical this is.

borkdude 2020-06-29T15:32:07.103400Z

That could work, but what about the code in the slingshot dir?

borkdude 2020-06-29T16:31:42.104300Z

clj-kondo now has docs for coc.neovim: https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md#cocnvim Thanks https://github.com/sittim

slimslenderslacks 2020-06-29T16:44:09.104700Z

I see ... if the config has hooks, you really would have to be able to pull down the hook code too. So if I was a library owner, I could ship a config.edn, AND hook code to users of my library.

borkdude 2020-06-29T16:45:05.104900Z

yes

borkdude 2020-06-29T16:45:36.105100Z

clj-kondo doesn't automatically import that (right now) so you have to copy that code yourself to your own .clj-kondo

slimslenderslacks 2020-06-29T16:48:24.105300Z

I'll see if I can get this to work on the serverless runner. So far, it seems like it should be possible to merge several libraries by referencing their github coords.

borkdude 2020-06-29T16:49:13.105500Z

clj-kondo has a merge-configs API function to merge configs btw

👍 1