slim-template / slim

Slim is a template language whose goal is to reduce the syntax to the essential parts without becoming cryptic.
https://slim-template.github.io
MIT License
5.29k stars 500 forks source link

Add standard gem for linting #925

Closed czj closed 1 year ago

czj commented 1 year ago

This PR only add standard to the Gemfile.

To lint, run :

standardrb

To lint and automatically fix, run :

standardrb --fix

Applying default code style

You can see there is a major code style difference.

An example PR applies all fixes : #926

GitHub Action

A GitHub Action exists in .github/workflows/lint.yml that you can run.

minad commented 1 year ago

As I suspected before in #924, plain Rubocop will be better for the purposes of Slim. I just checked the Standard gem and it is not a great idea for a project like Slim with a history. I agree that code consistency and coding standards are good, maybe even opinionated and rigid ones as promoted by StandardRB, however it is easier to use them in new projects in contrast to older ones.