/Ruby-Linters-Capstone

In this project, I implemented my own version of the stylistic error program Linter. Created using Ruby for Ruby code only.

Primary LanguageRuby

Ruby-Linters

In this project, I have implemented my own version of Linters using Ruby.

Built With

  • Ruby
  • VS Code

Getting Started

To get a local copy of the repository please run the following commands on your terminal:

$ cd <folder>
$ git clone https://github.com/garciajordy/Ruby-Linters-Capstone.git

To Use Rspec

$ cd Ruby-Linters-Capstone
$ rspec

To Test For Linter Errors

Copy your ruby file in the Ruby-Linters-Capstone folder

$ cd Ruby-Linters-Capstone
$ ruby bin/main.rb test.rb

Change test.rb with any file you would like to check

Good and Bad Examples

Indentation

Good Example

class Test
  def initialize(name)
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Bad Example

class Test
  def initialize(name)
@name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

White Trailing Space

Good Example

I Used the pipe "|" on the second line to indicate the cursor

class Test
  def initialize(name)|
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Bad Example

class Test
  def initialize(name) |
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Empty Line

Good Example

class Test
  def initialize(name)
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Bad Example

class Test
  def initialize(name)

    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Unexpected END

Good Example

class Test
  def initialize(name)
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Bad Example

class Test
  def initialize(name)
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end
end

Missing Closing Brackets

Good Example

class Test
  def initialize(name)
    @name = [name]
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Bad Example

class Test
  def initialize(name)
    @name = [name
    @age = name.length
  end

  def call_me
    puts "HEEEEY, #{@name}!!"
  end
end

Author Details

👤 Jordy Garcia

  • Github:
  • Linkedin:

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give ⭐ Star me on GitHub — it helps!