Skip to content

Fix lein eastwood warnings and some typos #8

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

Merged
merged 2 commits into from
Mar 25, 2018

Conversation

laurio
Copy link
Contributor

@laurio laurio commented Mar 22, 2018

No description provided.

Copy link
Collaborator

@tebeka tebeka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please take a look at my comments.

@@ -1,10 +1,8 @@
(ns digest
#^{ :author "Miki Tebeka <miki.tebeka@gmail.com>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the meta data (OK for my name, but the doc?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm sorry about removing your name and doc from require - i executed lein slamhound in project folder which optimised the require but also removed the meta data. Will restore it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(:require .. :refer ..) is a new way to do the same thing that allows effectively deprecate :use, which has some drawbacks. Please see https://stackoverflow.com/questions/871997/difference-between-use-and-require#comment25370819_16429572 for more details.

README.md Outdated
@@ -27,7 +27,7 @@ namespace. Each can handle the following input types:
"163883d3e0e3b0c028d35b626b98564be8d9d649ed8adb8b929cb8c94c735c59"

# Installation
Add `[digest "1.4.6"]` to your `project.clj`.
Add `[digest "1.4.7"]` to your `project.clj`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current version is 1.4.7, did you mean 1.4.8?
Also project.clj and ChangeLog need to be updated.

src/digest.clj Outdated
size (.read reader buffer)]
(when (pos? size)
(if (= size *buffer-size*) buffer (Arrays/copyOf buffer size)))))
(cond-> buffer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the same logic:

user=> (if true :buffer :new-buffer)
:buffer
user=> (if false :buffer :new-buffer)
:new-buffer
user=> (cond-> :buffer false :new-buffer)
:buffer
user=> (cond-> :buffer true :new-buffer)
nil

src/digest.clj Outdated
(:import java.util.Arrays
(java.security MessageDigest Security Provider)
(java.io FileInputStream File InputStream)))
(:require [clojure.string :refer [lower-case split] :as string])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why is requite better than use?
  • We how using functions from string without the prefix (lower-case, split) and with the prefix (string/join). I prefer one consistent way

src/digest.clj Outdated
(symbol (lower-case algorithm-name))
:doc (str "Encode the given message with the " algorithm-name " algorithm.")
:arglists '([message])))]
(-> 'digest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this better than the previous threading?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified threading in order to get rid of lein kibit warning - will restore the original version.

src/digest.clj Outdated
(doseq [algorithm (algorithms)]
(create-fn! algorithm)))
[]
(run! create-fn! (algorithms)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is run! better than doseq?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference between run! and doseq seems to be that run! doesn't support bindings which makes the code a bit shorter. Will restore doseq.

@laurio laurio force-pushed the fix/lein-eastwood-warnings branch from ee3ee86 to 67cf467 Compare March 23, 2018 19:14
@tebeka tebeka merged commit cad57d5 into clj-commons:master Mar 25, 2018
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.

2 participants