-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Linting fix #23
Linting fix #23
Conversation
Thanks for tackling this! Let me know when the PRs ready for review! |
Will do. |
NOTE: after discussing the below on Slack, I've just reused There are only two
Which is related to this function: https://github.com/clojure-emacs/nREPL/blob/380e161dae0f67c07645e2b4eb615797665ca989/src/main/clojure/clojure/tools/nrepl/misc.clj#L6-L17 From my conversation with the
Would you like to do that, have two configs:
Or do you have some other suggestion? |
Removal of whitespace and blanklines. Not intentional but my editor picked it up when saving. Grouping them all here under a single commit for brevity.
And to prevent it from issuing warnings
I've done this in order to suppress a warning from Eastwood
Reorganised the require so that it makes Eastwood happy
Reorganised the namespace declaration so that Eastwood would not complain
Eastwood warning: src/main/clojure/clojure/tools/nrepl/middleware.clj:151:29: local-shadows-var: local: comparator invoked as function shadows var: src/main/clojure/clojure/tools/nrepl/middleware.clj:151:29: local-shadows-var: local: comparator invoked as function shadows var: Renamed the argument in order to resolve the above.
Eastwood error: src/main/clojure/clojure/tools/nrepl/transport.clj:42:49: local-shadows-var: local: read invoked as function shadows var: #'clojure.core/read Fix for the above.
Added # in front of doall. Added additional ';' in front of a comment so that it's indented nicely. And then the rest are just indentation issues. Eastwood warning: src/test/clojure/clojure/tools/nrepl/load_file_test.clj:12:3: unused-ret-vals: Should use return value of function call, but it is discarded: (doall (nrepl/message timeout-session {:op "load-file", :file "\n\n\n(defn function [])"})) src/test/clojure/clojure/tools/nrepl/load_file_test.clj:24:3: unused-ret-vals: Should use return value of function call, but it is discarded: (doall (nrepl/message timeout-session {:op "load-file", :file "\n\n\n\n\n\n\n\n\n(defn afunction [])", :file-path "path/from/source/root.clj", :file-name "root.clj"})) src/test/clojure/clojure/tools/nrepl/load_file_test.clj:36:3: unused-ret-vals: Should use return value of function call, but it is discarded: (doall (nrepl/message timeout-session {:op "load-file", :file (slurp (File. project-base-dir "load-file-test/clojure/tools/nrepl/load_file_sample.clj")), :file-path "clojure/tools/nrepl/load_file_sample.clj", :file-name "load_file_sample.clj"})) src/test/clojure/clojure/tools/nrepl/load_file_test.clj:52:3: unused-ret-vals: Should use return value of function call, but it is discarded: (doall (nrepl/message session {:op "load-file", :file "(def a (+ 1 (+ 2 (+ 3 (+ 4 (+ 5 6))))))\n (def b 2) (def c 3) (def ^{:internal true} d 4)", :file-path "path/from/source/root.clj", :file-name "root.clj"}))
Eastwood error: src/main/clojure/clojure/tools/nrepl/middleware/interruptible_eval.clj:145:9: unused-ret-vals-in-try: Should use return value of static method call, but it is discarded inside body of try: (. java.lang.Class (forName "java.util.ServiceLoader"))
Switched to assert here as per Eastwood's documentation
Not only was it not being used, it had the :reason part outside the disable-warning config section
But adding it to the ignore config of eastwood so that if it needs to be removed it'll be easier.
There are two while functions within clojure.tools.nrepl-test which macroexpand to an if clause which is a constant logical true. Adding this warning suppression in order to keep eastwood happy.
The main reason for implementing this is because eastwood was warning on the two issues: * src/main/clojure/clojure/tools/nrepl/misc.clj:11:11: redefd-vars: Var log def'd 2 times at line:col locations: clojure/tools/nrepl/misc.clj:8:13 clojure/tools/nrepl/misc.clj:11:11 * src/main/clojure/clojure/tools/nrepl/misc.clj:8:13: bad-arglists: Function on var log defined taking # args [2 :or-more] but :arglists metadata has # args [0 :or-more] And I don't see the reason to reinvent logging, so just going with clojure.tools.logging.
This way it's more consistent with piggieback project so when it comes to removing/fix it, it can be done on both at the same time.
Ran lein cljfmt fix as that is one of the steps in the CI run. It was mostly just indentation issues. Since it's across the whole codebase, doing it in one commit.
cljfmt changed the order of the namespace arguments. Cleaned it up so that the name of the ns goes first followed by attr-map and then by require
Amended formatting of the code in the project in order to keep Eastwood happy.
All of the
eastwood
warnings have been resolved.All of the
cljfmt
issues resolved aswell.