Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.
/ slimcop Public archive

RuboCop runner for Slim template.

License

Notifications You must be signed in to change notification settings

r7kamura/slimcop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0b6905a · Aug 29, 2024
Jul 13, 2022
Dec 19, 2021
Jan 15, 2022
Oct 16, 2023
Jul 13, 2022
Dec 15, 2021
Dec 15, 2021
Dec 26, 2021
Oct 16, 2023
Dec 15, 2021
Dec 26, 2021
Oct 16, 2023
Dec 15, 2021
Aug 29, 2024
Dec 19, 2021
Oct 16, 2023
Apr 3, 2023

Repository files navigation

Slimcop

Gem Version test

RuboCop runner for Slim template.

Warning

This gem has been deprecated. Please consider using rubocop-slim instead.

Installation

Add this line to your application's Gemfile:

gem 'slimcop'

And then execute:

bundle install

Or install it yourself as:

gem install slimcop

Usage

Use slimcop executable to check offenses and auto-correct them.

$ slimcop --help
Usage: slimcop [options] [file1, file2, ...]
    -a, --auto-correct               Auto-correct offenses.
    -c, --config=                    Specify configuration file.
        --[no-]color                 Force color output on or off.

Example

$ slimcop 'spec/fixtures/**/*.slim'
Inspecting 1 file
C

Offenses:

spec/fixtures/dummy.slim:1:3: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
- "a"
  ^^^
spec/fixtures/dummy.slim:3:5: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| #{"c"}
    ^^^

1 file inspected, 2 offenses detected, 2 offenses auto-correctable

Configuration

Slimcop will start looking for the configuration file in the following locations:

  1. /path/to/project/.slimcop.yml
  2. /path/to/project/.rubocop.yml

For example, if you want to disable some cops on slimcop, you can add the following file to your project:

# .slimcop.yml
inherit_from:
  - .rubocop.yml

Foo/Bar:
  Enabled: false