magento / magento/magento-coding-standard

Exclude xml files for LineLength rule ?

Open
#398 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Progress: ready for grooming
Dominant language
PHP
Stars
375
Forks
165
PR merge metrics
No merged PRs in 30d

Description

I don't think having LineLength rule for xml is relevant. With XML indentation and a lot of nested tags (ie. system.xml), or with some tags that must have a full classname (ie. di.xml), it can be very counterproductive if not impossible.

That led us to exclude this rule from our checks, which is a shame since we don't see anymore legit alerts on .php files.

I suggest adding `*\.xml$` to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the LineLength rule configuration in the coding standard and review how its file patterns are applied. Exclude files ending in .xml as proposed, then verify that LineLength continues reporting legitimate issues in PHP files while XML files are ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.