Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter to check code style #779

Closed
andrykonchin opened this issue Jul 13, 2020 · 2 comments
Closed

Linter to check code style #779

andrykonchin opened this issue Jul 13, 2020 · 2 comments

Comments

@andrykonchin
Copy link
Member

andrykonchin commented Jul 13, 2020

I am wondering whether it makes sense to automate some code style rules (specific to RubySpec codebase) with linter (e.g. Rubocop)? Even if it requires adding custom rules/cops...

For instance linter could detect:

@eregon
Copy link
Member

eregon commented Jul 19, 2020

Currently RuboCop for ruby/spec is only run in this repo, not in CRuby, JRuby and TruffleRuby's copy of the specs.
It's kind of intentional, I don't want to bother people with overly strict style there, and it's usually trivial fixes when synchronizing.

I think for these 3 cases it's better in MSpec, in order:

  • the global constants & classes check is already implemented (with CHECK_LEAKS=true). Global methods not yet though.
  • could be a deprecation in MSpec (but need to fix usages in ruby/spec first to avoid many warnings)
  • can be easily checked in MSpec (but needs to fix cases in ruby/spec first too)

@eregon
Copy link
Member

eregon commented Jul 19, 2020

Also, as much as possible, I'd also like to keep ruby/spec free of dependencies besides MSpec, including using such checks.

@andrykonchin andrykonchin changed the title Check code style with linter Using linter to check code style Jul 19, 2020
@andrykonchin andrykonchin changed the title Using linter to check code style Linter to check code style Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants