peterbe / hashin

Helping you write hashed entries for packages in your requirements.txt
https://www.peterbe.com/plog/hashin
MIT License
105 stars 27 forks source link

hashin removes # when hashes were generated with pip-compile #124

Closed alaamub closed 2 years ago

alaamub commented 2 years ago

Looks like hashin removes # when hashes were generated with pip-compile originally. Example

-requests==2.25.1 \
-    --hash=sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804 \
-    --hash=sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e
-    # via -r project/requirements.in
+requests==2.22.0 \
+    --hash=sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4 \
+    --hash=sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31
MarkusH commented 2 years ago

I've opened a pull request to tackle this: https://github.com/peterbe/hashin/pull/125

alaamub commented 2 years ago

Awesome, Thank you!

peterbe commented 2 years ago

@alaamub Would you mind helping @MarkusH by checking out his branch and running python hashin.py ... against a file that had comments. And can you also help by asserting that the correct indentation of the now-kept comments are intact?