nadchif / adobe-brackets-encode-decode

Adobe Brackets IDE Extension that lets you to convert text selections to and from various formats
https://registry.brackets.io/
GNU General Public License v3.0
9 stars 15 forks source link

Solution to issue #8 #9

Closed Shankhanil closed 4 years ago

Shankhanil commented 4 years ago

I have introduced String ---> MD5 encoder.

Upcoming contributions: Implementing MD5 with CryptoJS module, to provide a more reliable way of hashing.

@nadchif

Shankhanil commented 4 years ago

I have having some failed checks. Can you tell me how can I resolve them? @nadchif

nadchif commented 4 years ago

I have having some failed checks. Can you tell me how can I resolve them? @nadchif

Try the following in your terminal.

To see what the errors are, run

npm test

To automatically fix some of the errors, you can run

eslint --fix

If errors comeback after fixing, check to see if your IDE has a "format code on save" enabled, and disable it temporarily.

please feel welcome to let me know if you need further assistance

nadchif commented 4 years ago

@Shankhanil I refactored your src/convertors/MD5.js file. Please check it and test. Comment back here if you are satisfied, and I will merge the file.

Shankhanil commented 4 years ago

Seems fine to me, pls go ahead with the merge. @nadchif

UPDATE: Pls let me try out the hack you mentioned in comment on issue #8. If that works out, we can throw away this HUGEEE code, and replace with a better and a more reliable one.

nadchif commented 4 years ago

Sure no problem. I will wait for you to tell me to go ahead with the merge.

Although, we will still be by importing the crypto-js code too. Check out the module's folder lib/crypto-js

Shankhanil commented 4 years ago

@nadchif I have made the changes, and have commited it. But the tests are failed due to formatting error. Can you pls help me refactor the code. After the refactor, the code will be fully ready for merge.

nadchif commented 4 years ago

Great work 👏 👏 Now, please run eslint --fix ./src/* in the root folder.

After that run npm test to see exactly why the tests are failing. You will see something like this:

20200419_201714

Shankhanil commented 4 years ago

@nadchif It's funny why I am facing these failed checks. When I am running the tests on my local computer, they seem absolutely fine. Just let me know how to refactor my code, I shall do it myself from the next commits

nadchif commented 4 years ago

I also don't know why this could be happening to you. To view the details of the failures online you can see the task here https://github.com/nadchif/adobe-brackets-encode-decode/actions/runs/82247800

On how to refactor and fix? I did it just as mentioned above. I ran eslint --fix ./src/* and then fixed all the failures

Shankhanil commented 4 years ago

Yes, I run eslint --fix ./src/* and, it is giving me an error on line crypto.MD5() saying that a function can not begin with a capital letter.

Here is the error 16:25 error A function with a name starting with an uppercase letter should only be used as a constructor new-cap

nadchif commented 4 years ago

Nice!!! You're almost there 😁 add the following right at the top of your src/MD5.js file

/* eslint-disable new-cap */
Shankhanil commented 4 years ago

Cool. it's done!!! @nadchif . Go ahead and review the code. if it's good to go, you can merge it. I also understood why the tests were failing. It'll not be a problem from the next commit. Thanks for your help

nadchif commented 4 years ago

Yoooohoooo 👏 Awesome work. Thank you for your contribution. @all-contributors please add @Shankhanil for code and ideas

allcontributors[bot] commented 4 years ago

@nadchif

I've put up a pull request to add @Shankhanil! :tada: