Skip to content

Commit 5543820

Browse files
author
skiera
committed
Ticket 79: exclude generic standard
1 parent a53f287 commit 5543820

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/org/phpsrc/eclipse/pti/tools/codesniffer/PHPCodeSnifferPlugin.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,17 @@ public String[] getCodeSnifferStandards(String lib) {
106106
if (!standardPath.exists())
107107
standardPath = new File(libPath + "/PEAR/PHP/CodeSniffer/Standards");
108108
} else {
109-
standardPath = new File(PHPLibraryPEARPlugin.getDefault().resolvePluginResource(DEFAULT_PEAR_LIB_PATH)
110-
.toPortableString());
109+
standardPath = new File(PHPLibraryPEARPlugin.getDefault()
110+
.resolvePluginResource(DEFAULT_PEAR_LIB_PATH).toPortableString());
111111
}
112112

113113
if (standardPath == null || !standardPath.exists())
114114
return new String[0];
115115

116116
File[] dirs = standardPath.listFiles(new FileFilter() {
117117
public boolean accept(File f) {
118-
return f.isDirectory() && !f.getName().startsWith(".");
118+
return f.isDirectory() && !f.getName().startsWith(".")
119+
&& !f.getName().toLowerCase().equals("generic");
119120
}
120121
});
121122

@@ -132,7 +133,8 @@ public boolean accept(File f) {
132133

133134
public IPath[] getPluginIncludePaths(IProject project) {
134135
PHPCodeSnifferPreferences prefs = PHPCodeSnifferPreferencesFactory.factory(project);
135-
IPath[] pearPaths = PHPLibraryPEARPlugin.getDefault().getPluginIncludePaths(prefs.getPearLibraryName());
136+
IPath[] pearPaths = PHPLibraryPEARPlugin.getDefault().getPluginIncludePaths(
137+
prefs.getPearLibraryName());
136138

137139
IPath[] includePaths = new IPath[pearPaths.length + 1];
138140
includePaths[0] = resolvePluginResource("/php/tools");

0 commit comments

Comments
 (0)