Bug #12203

Exclude-Pattern for Sniffs / Folders

Added by Andy Grunwald over 2 years ago. Updated 8 months ago.

Status:Closed Start date:2011-01-14
Priority:Should have Due date:
Assignee:Andy Grunwald % Done:

100%

Category:Stuff Spent time: -
Target version:0.0.4
Branch: Tags:
Votes: 0

Description

As you can see in Bug #11598

Christian wrote:

With PHP_CodeSniffer 1.3.0RC2 the exclude pattern can be set on a ruleset basis:

http://www.squizlabs.com/php-codesniffer/rule-based-exclude-patterns

Thus I'd suggest to store the exclude patterns in these rulesets and not in Hudson from now on.

Create a list of exclude patterns and think about which sniffs are affected


Related issues

related to PHP_CodeSniffer - Bug #11598: PHP Notice: Undefined offset: 7139708045 in /usr/share/p... Closed 2010-12-20
related to PHP_CodeSniffer - Feature #36869: Exclude class.t3lib_utility_debug.php from DebugCodeSniff Closed 2012-05-05
related to PHP_CodeSniffer - Feature #36870: Exclude class.doublemetaphone.php from checking Closed 2012-05-05

Associated revisions

Revision b603e934
Added by Andy Grunwald 11 months ago

[BUGFIX] Extend TYPO3.Debug.DebugCode-Sniff for more cases

In current TYPO3v4 master branch, the debug-method was
moved from t3lib_div::debug to t3lib_utility_Debug::debug.
The current implementation of this sniff does not cover
this method call.

Further more, the error message was improved to be
more flexible.

Change-Id: I8017b32d73ec0d4bdb6c1ccc73d61890e9ce586f
Fixes: #12203
Releases: 0.0.4

History

Updated by Stefano Kowalke over 2 years ago

Exclude patterns works not on ruleset base, but on sniff base. So we can exclude specific files and folders from a single sniff.

Generally exclusions should be in hudson further on.

Updated by Christian Trabold over 2 years ago

Stefano Kowalke wrote:

Exclude patterns works not on ruleset base, but on sniff base. So we can exclude specific files and folders from a single sniff.

Generally exclusions should be in hudson further on.

So the title of the new feature is a bit confusing. Sure thing Hudson will still set own exclusions.

Updated by Christian Trabold almost 2 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Stefano Kowalke

What's the current status of this issue?

We can set custom sniffs with Sonars WebGUI as well ("Quality profiles").

Updated by Christian Trabold almost 2 years ago

  • Category set to CodeAnalysis

Updated by Stefano Kowalke about 1 year ago

  • Category changed from CodeAnalysis to Stuff
  • Status changed from Needs Feedback to Accepted
  • Target version set to 0.0.4

I reread this feature request and now I have an imagination how we could use this feature.
We exclude 3rd party code as usual in jenkins by command line options, but we exclude the sniff which detects

debug() 
statements just for t3lib_div::debug() (or how this function called today).

Any opinions?

Updated by Gerrit Code Review about 1 year ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10857

Updated by Andy Grunwald about 1 year ago

  • Status changed from Accepted to Under Review

Updated by Andy Grunwald about 1 year ago

I like your idea.
In my opinion this is the best solution, because on this way, the sniffs / standard are more flexible.

I`ve added two new unit test cases for the new debug functions and make the error message in this sniff more flexible for method names.
I will inform Christian about this issue. Perhaps he has to extend his exclude rules.

Updated by Andy Grunwald about 1 year ago

  • Assignee changed from Stefano Kowalke to Andy Grunwald

Updated by Christian Trabold about 1 year ago

These are the exclude-Patterns we currently use in the following jobs:

  1. https://ci.typo3.org/view/TYPO3/view/Core/job/typo3-v4-core-gerrit/
    .git,typo3/sysext/dbal,typo3/sysext/openid/lib,typo3/contrib,typo3/sysext/adodb,typo3/sysext/em/mod1/class.nusoap.php,typo3/sysext/fluid,typo3/sysext/extbase
    
  2. https://ci.typo3.org/view/TYPO3/view/Core/job/typo3-v4-core-nightly/
    .git,typo3/sysext/openid/lib,typo3/contrib,typo3/sysext/adodb,typo3/sysext/fluid,typo3/sysext/extbase
    

Updated by Andy Grunwald about 1 year ago

  • Target version changed from 0.0.4 to 0.0.5

Updated by Andy Grunwald about 1 year ago

  • Target version changed from 0.0.5 to 0.0.4

Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10857

Updated by Gerrit Code Review 11 months ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10857

Updated by Andy Grunwald 11 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Updated by Stefano Kowalke 8 months ago

  • Tracker changed from Suggestion to Bug
  • Status changed from Resolved to Closed

Also available in: Atom PDF