fix: allow concurrent prettier setups by simschla · Pull Request #2462 · diffplug/spotless

added a commit to simschla/spotless that referenced this pull request

Apr 7, 2025

@simschla

without this change, using the exact same npm-based formatter (e.g.
prettier) in multiple formatters, we could end up using the same
directory to store their node_modules inside. This could lead -
especially when using parallel builds, to a lot of issues:
- overwriting each others node_modules mid-flight
- overwriting package.json mid-flight
- starting multiple npm-based servers on the same directory (overwriting
the port-file thus leading to cross-access between formatter steps and
their corresponding node server).

By applying this fix, each formatter will have its own separate
node_modules directory.

@simschla

@simschla

simschla

@simschla

nedtwigg

@simschla

@simschla

@simschla

to be able to launch multiple instances of npm in the same node_modules
dir.

Refs: diffplug#2462

@simschla

before: make sure every formatter uses its own node_modules dir.
now: actively support using same node_modules dir for multiple
formatters

Refs: diffplug#2462

@simschla

nedtwigg

This was referenced

Jul 3, 2025

simschla added a commit to simschla/spotless that referenced this pull request

Dec 9, 2025
…rs on same node_modules

Before this change: if two (or more) node-based servers have been
started on the same node_modules dir, the could override each others
temporary port files, resulting in some of the servers not correctly
launching.
With this change: each server process makes sure to write distinct
temporary and final files for transporting selected port number to the
launching java process.
This is a fixup for diffplug#2462.

Refs: diffplug#2462, diffplug#2542

simschla added a commit to simschla/spotless that referenced this pull request

Dec 9, 2025