Skip to content

[Bug]: Exclude not working when format on save #517

@edikurniawan-dev

Description

@edikurniawan-dev

Extension Version

1.2.3

PHP Binary

Local PHP

Operating System

Windows

What happened?

This is my Pint configuration. When I run ./vendor/bin/pint, the routes directory is correctly excluded, and everything works as expected.

However, when I save the file (Ctrl+S) in routes/web.php, Pint still formats the file according to the defined rules. Why does Pint format the file on save even though the routes directory is excluded?

// pint.json

{
  "preset": "laravel",
  "exclude": ["routes"],
  "rules": {
    "binary_operator_spaces": {
      "default": "single_space",
      "operators": {
        "=>": "align_single_space_minimal",
        "=": "align_single_space_minimal"
      }
    },
    "types_spaces": {
      "space": "single"
    },
    "method_argument_space": {
      "on_multiline": "ensure_fully_multiline"
    },
    "phpdoc_align": true,
    "single_quote": true,
    "declare_strict_types": false,
    "blank_line_before_statement": {
      "statements": ["return", "throw"]
    },
    "class_attributes_separation": {
      "elements": {
        "const": "one",
        "method": "one",
        "property": "one"
      }
    },
    "no_trailing_whitespace": true,
    "no_extra_blank_lines": {
      "tokens": ["extra"]
    },
    "lambda_not_used_import": true,
    "not_operator_with_successor_space": false,
    "no_spaces_after_function_name": true,
    "simplified_null_return": true,
    "array_indentation": true
  }
}

Mimimal Code Sample

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions