eastwood

All things realted to eastwood - the Clojure linter
2018-09-19T00:20:18.000100Z

is there an example of a working :deprecations disable for a java class? the example in the readme isn't valid edn and I can't seem to make my regex do what I expect (I'm only targeting one method)

2018-09-19T00:27:51.000100Z

minimal surprising failure: #".*" successfully suppresses the warning, #"org\.apache\.*" does not

2018-09-19T00:30:44.000100Z

src/ledger/topology.clj:561:8: deprecations: Static method 'public static org.apache.kafka.streams.state.Stores$StoreFactory org.apache.kafka.streams.state.Stores.create(java.lang.String)' is deprecated.

2018-09-19T00:32:18.000100Z

do I need the literal contents in the '' there?

2018-09-19T05:30:32.000100Z

Hmm. I am trying to reproduce the issue and figure out how to make that work, but I apparently no longer know how to install a version of Eastwood from source code with the latest code.

2018-09-19T05:32:27.000100Z

It used to be I could edit the project.clj file of Eastwood's source to some version number like "0.2.10-SNAPSHOT", type the command lein install, edit my $HOME/.lein/profile.clj file to include {:user {:plugins [[jonase/eastwood "0.2.10-SNAPSHOT"]]}}, and go into any other Leiningen project directory and type lein eastwood, and it would run that version of Eastwood's source code.

2018-09-19T05:35:24.000100Z

Right now, when I try that sequence of steps, starting from an empty $HOME/.m2 directory, the lein install step does create version 0.2.10-SNAPSHOT of an Eastwood jar file in my $HOME/.m2 directory tree, with no version 0.2.8 or any other version of Eastwood. However, when I edit the $HOME/.lein/profiles.clj file and type lein eastwood in a different Lein project root directory, it downloads Eastwood 0.2.8 jar file from Clojars, and uses that instead.

2018-09-19T05:35:37.000100Z

That really confuses me. No idea why that would happen.

2018-09-19T05:35:57.000100Z

Maybe something weird involving the sha in Eastwood's resources/EASTWOOD_VERSION file?

2018-09-19T05:36:16.000100Z

@slipset ? ^^^

slipset 2018-09-19T06:32:04.000100Z

I’m at a conference today, so I’ll probably not be able to handle it today, but I’ll look into it tomorrow

2018-09-19T07:11:00.000100Z

Thanks, no rush. I can create an issue on Eastwood Github if that would be preferable.

slipset 2018-09-19T07:34:55.000100Z

That’d be great!

2018-09-19T07:50:29.000100Z

Created one, with a sequence of steps that I used to be able to use around Eastwood 0.2.7 in order to create a local -SNAPSHOT version and run it locally, but now downloads and uses 0.2.8 instead.

2018-09-19T18:27:33.000100Z

I'm still stuck on how to whitelist a static method as an exclusion in the deprecations linter

2018-09-19T19:08:34.000100Z

I'm still baffled why I can't locally install and run the latest Eastwood source in my ~/.m2 🙂

2018-09-19T19:08:47.000100Z

Asking in the #leiningen channel and created an issue.

2018-09-19T19:09:44.000100Z

Not saying that it is impossible to answer your question without doing that, but I'm not sure that in the current state, deploying a new Eastwood release to Clojars will actually let you run it, since I'm not sure it is even possible to run Eastwood 0.2.9 that is in Clojars, let alone a new version I might deploy.

2018-09-19T19:10:41.000100Z

If I can't run a locally installed Eastwood from source, I can't add debug print messages around the code of the deprecations linter to experiment and see what regexes might be useful there.

2018-09-19T19:11:01.000100Z

sorry, I'm just venting a bit there.

2018-09-19T19:11:35.000100Z

Maybe a cooler head will have an idea for this I'm not thinking of.

2018-09-19T20:01:06.000100Z

OK - thanks - I wasn't sure you'd noticed my question about that earlier, now I see how not being able to install locally would be a reply to that

2018-09-19T20:01:57.000100Z

It was prompted by trying to answer your question, although far from obvious what the cause and effect were there 🙂

2018-09-19T20:02:43.000100Z

Hmm. Maybe I can debug a slightly older version of Eastwood that has the deprecations code in it, if it was added early enough to avoid the recent weirdness.

2018-09-19T20:02:53.000100Z

I might find a few minutes to make a repro issue with some static method in the default jvm that's deprecated

2018-09-19T20:03:23.000100Z

just in case the issue is deprecated-static-method specific

2018-09-19T20:04:06.000100Z

That'd be cool, although I may have recreated one with the same class you had, after some Google'ing about. I probably don't have a matching version and all that, so one you create that has the deprecation warning would be useful.

2018-09-19T20:04:45.000100Z

up to date apache kafka would replicate

2018-09-19T20:04:52.000100Z

If I figure it out, I may even be able to improve the docs a bit for that feature in Eastwood's README

2018-09-19T20:05:32.000100Z

cool - unit tests can act as docs too, I'll see if I can find some time for something like that (which would mean deprecated static method in regular vm would be nice)

2018-09-19T20:25:26.000100Z

repro:

(ns deprecation.core)                                                           
                                                                                
(defn foo                                                                       
  "I don't do a whole lot."                                                     
  [x]                                                                           
  (java.net.URLDecoder/decode "foo"))
(disable-warning                                                                
  {:linter :deprecations                                                        
   :symbol-matches #{#"^java\.net\.URLDecoder"}})
changing the regex to #".*" disables the warning

slipset 2018-09-19T21:20:15.000100Z

@noisesmith away from computer, so can’t think, but I have answered this before somewhere.

slipset 2018-09-19T21:20:35.000100Z

That was more a clue to myself, than anything else

slipset 2018-09-19T21:30:27.000200Z

https://github.com/jonase/eastwood/issues/264

slipset 2018-09-19T21:33:04.000100Z

@noisesmith ^^ so basically, you need to either prefix your regex with whatever modifiers your java-method has, or your regex needs to be something like #".*?java\.net\.URLDecoder"

2018-09-19T21:39:01.000100Z

thanks - I had something like that earlier but must have had a subtle error