Coala Tutorial: Correct your codes easily with Coala !!

in #utopian-io7 years ago

What is Coala?

It is an open source software that helps you to check your program for errors and even correct them. As per its official documentation: "coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use."

Coala plugins: Coala Bears !

Coala comes with a set of plugins called coala bears which perform different checks. Coala supports carious languages like C/C++, Python, JavaScript, CSS, Java and more.

Installation.

Prior to learning "How to use Coala to correct your code", you need to have coala installed first. Follow this guide to install coala in your system.

Let's start with correcting some code.

Step 1: Reaching the folder

Open command prompt/PowerShell on Windows or Terminal on Mac and reach the directory where the code is present using cd command. You can then use dir command to see what is inside the folder (in windows). For Mac or Linux, the command for checking files inside a folder is ls
image.png

Step 2: Carrying out the Check:

In order to specify which file to analyze we will use --files argument of coala. As already discussed above, we have something called coala bears in coala. these can be thought of as plugins or analysis routines. Coala bears can do things like checking your code for probloems and even offer fixes. In order to specify which bears to use, we specify the argument --bears. To instruct coala to save the changes, we will use the argument --save. Hence the code that we will use is:

coala --files=setupTests.js --bears=SpaceConsistencyBear --save

image.png

Step 3: Final

Coala then asks Please enter a value for the setting "use_spaces" (True if spaces are to be used instead of tabs.) needed by SpaceConsistencyBear for section "cli":

Enter true. However, you can also enter any other value.

Then it shows the message : Executing section CLI...
image.png

Conclusion

Coala can be used very easily. Also since it is an open source project where begginers can colaborate, I recommend everyone to get involved with this communtiy.

To reach out the coala community:

Connect on github
Connect on gitter



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @shreyasgune I am @utopian-io. I have just upvoted you at 7% Power!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!
  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • I introduced a competition factor. My vote is based also on how competitive the category used is.

Human Curation

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]