Skip to content

bug: php-cs-fixer not working if add in args --path-mode=intersection #861

@FETWEB

Description

@FETWEB

Neovim version (nvim -v)

NVIM v0.11.6

Operating system/version

OS: Debian GNU/Linux 13 (trixie) x86_64. Host: Windows Subsystem for Linux - Debian (2.6.3.0)

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

2026-03-12 04:08:27[DEBUG] Running formatters on /home/fetweb/projects/nikishow/public/api/mail.php: { "php_cs_fixer"}
2026-03-12 04:08:27[INFO] Run php_cs_fixer on /home/fetweb/projects/nikishow/public/api/mail.php
2026-03-12 04:08:27[DEBUG] Creating temp file /home/fetweb/projects/nikishow/public/api/.conform.9593735.mail.php
2026-03-12 04:08:27[DEBUG] Run command: { "/home/fetweb/.local/share/nvim/mason/bin/php-cs-fixer", "fix", "--path-mode=intersection", "/home/fetweb/projects/nikishow/public/api/.conform.9593735.mail.php" }
2026-03-12 04:08:27[DEBUG] Run CWD: /home/fetweb/projects/nikishow
2026-03-12 04:08:27[DEBUG] php_cs_fixer exited with code 0
2026-03-12 04:08:27[DEBUG] Cleaning up temp file /home/fetweb/projects/nikishow/public/api/.conform.9593735.mail.php

Describe the bug

I am trying use exclude path in .php-cs-fixer.dist.php.
Php-cs-fixer docs say "By default --path-mode is set to override, which means, that if you specify the path to a file or a directory via command arguments, then the paths provided to a Finder in config file will be ignored. You can also use --path-mode=intersection, which will use the intersection of the paths from the config file and from the argument:"
So im trying to add args, but when i add it, format on save not working.

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

Just add to args --path-mode=intersection

Expected Behavior

Should be formatting when saving

Minimal example file

return {
"stevearc/conform.nvim",
  opts = {
    formatters = {
      php_cs_fixer = {
        stdin = false,
        args = {
          "fix",
          "--path-mode=intersection",
          "$FILENAME",
        },
      },
    },
  },
}

Additional context

Auto format is workign if remove from args --path-mode=intersection.
Working config

return {
"stevearc/conform.nvim",
  opts = {
    formatters = {
      php_cs_fixer = {
        stdin = false,
        args = {
          "fix",
          "$FILENAME",
        },
      },
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions