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-scalastyle-1

v0.4.1

Published

Scalastyle adapter — CLI-mode Scala style checker

Readme

@codacy/tools-scalastyle-1

Table of Contents


Overview

Scala style checker and static analysis tool using the Scalastyle assembly JAR. Uses the CLI execution strategy -- spawns java -cp scalastyle.jar org.scalastyle.Main via spawnTool() and parses its Checkstyle-format XML output.

| Property | Value | | ------------- | --------------------------------------------- | | Tool ID | ScalaStyle | | Codacy UUID | 21586cd3-3eaa-4454-878e-ac0211a833c2 | | Strategy | CLI | | Languages | Scala | | Binary | java -cp scalastyle.jar org.scalastyle.Main | | File patterns | **/*.scala | | Pattern count | 74 |

Scalastyle is primarily a Scala 2 tool. It parses Scala source files and checks for style violations, complexity issues, and potential bugs. The assembly JAR is hosted on Maven Central.

Updating patterns

# Re-fetch pattern metadata from the Codacy API
pnpm prefetch

# Commit the result
git add src/patterns.json

Pattern IDs follow the format ScalaStyle_MagicNumberChecker, ScalaStyle_FileLengthChecker, etc. Note the capital S in ScalaStyle and that the Checker suffix is retained (unlike Checkstyle which strips Check).

Updating the Scalastyle version

  1. Update SCALASTYLE_VERSION in src/adapter.ts
  2. Update JAR_URL to point to the new assembly JAR on Maven Central
  3. Run pnpm prefetch to check for new/removed rules
  4. Run pnpm test to verify compatibility
  5. If the major version changes, create a new adapter package (scalastyle-2/)

The Maven Central artifact coordinates are:

com.beautiful-scala:scalastyle_2.13:{version}:assembly

Development

pnpm build    # Build with tsup
pnpm test     # Run tests (unit tests always run; integration tests require java + JAR)

To install the Scalastyle JAR locally for integration testing:

mkdir -p /tmp/codacy-scalastyle-test-tools
curl -L -o /tmp/codacy-scalastyle-test-tools/scalastyle.jar \
  https://repo1.maven.org/maven2/com/beautiful-scala/scalastyle_2.13/1.5.1/scalastyle_2.13-1.5.1-assembly.jar

Notes for maintainers

  • Scalastyle requires Java 8+ as a runtime. The adapter uses ensureJre() to download Adoptium Temurin JDK 17 if no system Java is found.
  • The assembly JAR (~9 MB) is downloaded from Maven Central via downloadJar() to ~/.codacy/tools/scalastyle-1/.
  • Scalastyle takes directories as input, not individual file lists. The adapter passes the repository root and then filters the XML output by ctx.targetFiles.
  • XML output is written to a temp file via --xmlOutput, not to stdout. The adapter reads and parses the temp file after execution.
  • The source attribute in XML output is an FQCN like org.scalastyle.scalariform.MagicNumberChecker. The adapter extracts the last segment to derive the pattern ID.
  • Checker namespace mapping: checkers in the static FILE_LEVEL_CHECKERS set map to org.scalastyle.file.*; all others map to org.scalastyle.scalariform.*.
  • Exit code 0 = clean, 1 = findings found or error. The adapter reads the XML output regardless of exit code (0 or 1).
  • Config file detection looks for scalastyle_config.xml or scalastyle-config.xml in the repository root (underscore variant preferred).
  • When generating config from patterns, each check is emitted with level="warning" and includes default parameters from patterns.json.
  • The column attribute may be absent in Scalastyle output; it is omitted from the issue when not present.
  • fast-xml-parser is configured with ignoreAttributes: false and isArray for file/error elements to handle single-element cases.