About • Prerequisites • Available Inspections • Getting Started • Under The Hood • Contributing • Authors • License
This repository contains a static code analyzer tool for Ruby source code. It inspects the code for styling and complexity errors. This tool aims to help enforce appropriate programming practices.
To use the program Parser and Colorize gems must be installed on the local machine.
To install parser gem, run the following command in the terminal emulator.
gem install parser
To install Colorize gem, run the following command in the terminal emulator.
gem install colorize
Please refer to this documentation to understand all the inspection features.
To get started you have to clone the repo on your local machine. To clone the repo run the following command in a terminal emulator:
git clone https://github.com/smcommits/CodeAnalyzer
Alternatively, you can click this link to download the repo as a zip file.
Now navigate to the bin directory using the following command
cd bin
Run the linter by executing main.rb file using the followed by the path to your file. You can also run -h to get help.
./main.rb path/to/your/file
Example:
./main.rb ~/code/my_ruby_code.rb
After executing, the tool will inspect for any errors and display the error location, type, and message.
This project uses Abstract Syntax Tree and Lexical Analysis to analyze the code for errors. Parser gem is used to implement the solutions requiring AST, and ruby Ripper library is used to implement the solutions that require lexical analysis.
👤 Anas Siddiqui
- GitHub: Anas Siddiqui
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
To add colors to the user interface.
This project is still very new and will not produce completely accurate results. Therefore, it should not be your primary source of linting. If you are looking for a Ruby source code linter, then use Rubocop
This project is MIT licensed.