npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codacy/tools-rubocop-1

v0.2.0

Published

RuboCop adapter — CLI-mode Ruby linter and formatter

Downloads

48

Readme

@codacy/tools-rubocop-1

Table of Contents


Overview

Ruby linter and formatter using RuboCop with 22+ plugin gems. Uses the CLI execution strategy -- spawns rubocop --format json via spawnTool() and parses its JSON output.

| Property | Value | | ------------- | ------------------------------------------------------------------- | | Tool ID | RuboCop | | Codacy UUID | 724f98da-f616-4e37-9606-f16919137a1e | | Strategy | CLI | | Languages | Ruby | | Binary | rubocop (installed via gem install) | | File patterns | **/*.rb, **/*.rake, **/*.gemspec, **/Gemfile, **/Rakefile |

Updating patterns

pnpm prefetch
git add src/patterns.json

Pattern IDs use underscore-separated cop names (no prefix): Style_StringLiterals, Lint_Debugger, Metrics_MethodLength, etc.

Updating the RuboCop version

  1. Update RUBOCOP_VERSION in src/adapter.ts
  2. Review plugin gem compatibility -- some plugins pin specific RuboCop versions
  3. Run pnpm prefetch to check for new/removed cops
  4. Run pnpm test to verify compatibility
  5. If the major version changes, create a new adapter package (rubocop-2/)

Development

pnpm build    # Build with tsup
pnpm test     # Run tests (requires ruby + rubocop in PATH for integration tests)

To install rubocop locally for testing:

gem install rubocop -v 1.80.2
gem install rubocop-performance rubocop-rails rubocop-rspec

Notes for maintainers

  • RuboCop requires Ruby >= 2.7. The adapter uses ensureRuby() for portable Ruby download.
  • 22+ plugin gems are installed alongside rubocop, matching the Codacy codacy-rubocop wrapper. The full list is in GEM_PACKAGES in adapter.ts. Plugin gems are installed without version pins (except rubocop itself) to let gem resolve compatible versions.
  • Gems are installed in ~/.codacy/runtimes/rubocop-1/gems/ via GEM_HOME/GEM_PATH.
  • Output format is JSON with files[].offenses[] structure.
  • Pattern IDs: cop_name with / replaced by _ (e.g. Style/StringLiteralsStyle_StringLiterals).
  • Line/column are 1-based — direct mapping, no conversion needed.
  • Multi-line offenses: location.start_line/location.last_line map to Issue.line/Issue.endLine.
  • Exit codes: 0 = clean, 1 = offenses found (normal success), 2 = error.
  • --force-exclusion ensures config exclusions apply even for explicitly listed files.
  • --cache false ensures fresh analysis on every run.
  • Pattern filtering is post-hoc: RuboCop runs against all provided files with all cops, then output is filtered by the enabled patterns set.
  • Config file detection supports .rubocop.yml, .config/.rubocop.yml, .config/rubocop/config.yml.