<commit_before># README

**Rlint is currently alpha quality, expect things to break and change without
notice. Patches and bug reports are more than welcome.**

Rlint (short name for Ruby Lint) is a linter and static code analysis tool for
Ruby inspired by similar tools such as JSHint. It makes it possible for
developers to detect errors such as undefined (or unused) variables and the
use of non existing methods.

## Requirements

* Ruby 1.9 or newer
* Ripper (comes bundled with Ruby 1.9)

## Installation

Rlint can be installed by running the following command:

    $ gem install ruby-lint

Please note that there already is an existing gem called "rlint". This Gem is
**not** the same, it just happens to be a similar project (one that seems
abandoned) that uses the same name.

## Usage

Rlint can be used in two different ways: using the CLI interface and by using
the Ruby code directly.

The CLI can be used using the command `rlint`, see the output of `rlint --help`
for more information on how to configure it and how to analyze Ruby files.

The Ruby code itself takes a bit more effort but gives you more flexibility. In
the future you'll also be able to customize Rlint using a Ruby configuration
files. In order to analyze Ruby code you'll need a few things:

* An instance of `Rlint::Iterator`
* An instance of `Rlint::Report`
* A formatter for the report
* A block of Ruby code
* A number of analyzer classes such as `Rlint::Analyze::UndefinedVariables`

A short example is the following:

    require 'rlint'

    code      = 'obviously your Ruby code goes in here'
    tokens    = Rlint::Parser.new(code).parse
    report    = Rlint::Report.new
    formatter = Rlint::Formatter.new
    iterator  = Rlint::Iterator.new(report)
<commit_msg>Updated a require call in the README.<commit_after># README

**Rlint is currently alpha quality, expect things to break and change without
notice. Patches and bug reports are more than welcome.**

Rlint (short name for Ruby Lint) is a linter and static code analysis tool for
Ruby inspired by similar tools such as JSHint. It makes it possible for
developers to detect errors such as undefined (or unused) variables and the
use of non existing methods.

## Requirements

* Ruby 1.9 or newer
* Ripper (comes bundled with Ruby 1.9)

## Installation

Rlint can be installed by running the following command:

    $ gem install ruby-lint

Please note that there already is an existing gem called "rlint". This Gem is
**not** the same, it just happens to be a similar project (one that seems
abandoned) that uses the same name.

## Usage

Rlint can be used in two different ways: using the CLI interface and by using
the Ruby code directly.

The CLI can be used using the command `rlint`, see the output of `rlint --help`
for more information on how to configure it and how to analyze Ruby files.

The Ruby code itself takes a bit more effort but gives you more flexibility. In
the future you'll also be able to customize Rlint using a Ruby configuration
files. In order to analyze Ruby code you'll need a few things:

* An instance of `Rlint::Iterator`
* An instance of `Rlint::Report`
* A formatter for the report
* A block of Ruby code
* A number of analyzer classes such as `Rlint::Analyze::UndefinedVariables`

A short example is the following:

    require 'ruby-lint'

    code      = 'obviously your Ruby code goes in here'
    tokens    = Rlint::Parser.new(code).parse
    report    = Rlint::Report.new
    formatter = Rlint::Formatter.new
    iterator  = Rlint::Iterator.new(report)

{'fraction_non_alphanumeric': 0.05918827508455468, 'fraction_numerical': 0.002254791431792559, 'mean_word_length': 3.908713692946058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4246990', 'n_tokens_mistral': 974, 'n_tokens_neox': 936, 'n_words': 536}