diff options
Diffstat (limited to 'rpm/org.eclipse.linuxtools.rpm.rpmlint')
6 files changed, 276 insertions, 276 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml b/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml index 0dc63f206c..67731553a1 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/plugin.xml @@ -39,12 +39,12 @@ id="rpmlint.runRpmlint.command"/> </extension> <extension point="org.eclipse.ui.handlers"> - <handler - class="org.eclipse.linuxtools.internal.rpm.rpmlint.actions.ToggleRpmlintNatureAction" - commandId="rpmlint.toggleRpmlint.command" /> - <handler - class="org.eclipse.linuxtools.internal.rpm.rpmlint.actions.RunRpmlintAction" - commandId="rpmlint.runRpmlint.command" /> + <handler + class="org.eclipse.linuxtools.internal.rpm.rpmlint.actions.ToggleRpmlintNatureAction" + commandId="rpmlint.toggleRpmlint.command" /> + <handler + class="org.eclipse.linuxtools.internal.rpm.rpmlint.actions.RunRpmlintAction" + commandId="rpmlint.runRpmlint.command" /> </extension> <extension point="org.eclipse.ui.menus"> @@ -122,5 +122,5 @@ class="org.eclipse.linuxtools.internal.rpm.rpmlint.resolutions.RpmlintMarkerResolutionGenerator" markerType="org.eclipse.linuxtools.rpm.rpmlint.rpmlintProblem"/> </extension> - + </plugin> diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/parser/RpmlintItem.java b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/parser/RpmlintItem.java index 724b4df08b..7a2e50be5f 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/parser/RpmlintItem.java +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/parser/RpmlintItem.java @@ -17,164 +17,164 @@ import org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileParser; */ public class RpmlintItem { - private static final String[] SECTIONS = SpecfileParser.simpleSections; - - private int lineNbr; - - private int severity; - - private String id; - - private String refferedContent; - - private String message; - - private String fileName; - - /** - * Returns the name of the file rpmlint gives warning for. - * - * @return The file name. - */ - public String getFileName() { - return fileName; - } - - /** - * Sets the name of the file rpmlint gives warning for. - * @param file The File name. - */ - public void setFileName(String file) { - this.fileName = file; - } - - /** - * Returns the line number where the warning appears if rpmlint gives it. - * @return The line number. - */ - public int getLineNbr() { - return lineNbr; - } - - /** - * Sets the line number where the warning appears if rpmlint gives it. - * @param lineNbr The line number. - */ - public void setLineNbr(int lineNbr) { - this.lineNbr = lineNbr; - } - - /** - * The id of the warning. - * @return The id. - */ - public String getId() { - return id; - } - - /** - * Sets the id of the warning. - * @param id The id of the warning. - */ - public void setId(String id) { - this.id = id; - } - - /** - * Returns the message as rpmlint gives it. - * @return The message. - */ - public String getMessage() { - return message; - } - - /** - * Sets the message as rpmlint gives it. - * @param message The raw message. - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Returns the referred content - section, tag, etc. - * @return The referred content. - */ - public String getRefferedContent() { - return refferedContent; - } - - /** - * Sets the referred content. - * @param refferedContent The referred content. - */ - public void setRefferedContent(String refferedContent) { - for (int i = 0; i < SECTIONS.length; i++) { - if (refferedContent.startsWith(SECTIONS[i])) { - this.refferedContent = refferedContent.trim(); - if (this.refferedContent.equals("")) {//$NON-NLS-1$ - this.refferedContent = SECTIONS[i]; - } - i = SECTIONS.length; - } else { - this.refferedContent = refferedContent; - } - } - } - - /** - * Returns the severity of the rpmlint item. - * - * @return The severity. - */ - public int getSeverity() { - return severity; - } - - /** - * Returns the severity of the rpmlint item. - * - * @param severity The severity of the rpmlint item. - */ - public void setSeverity(String severity) { - severity = severity.replaceAll(":", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$ - switch (severity.charAt(0)) { - case 'I': - this.severity = 0; - break; - case 'W': - this.severity = 1; - break; - case 'E': - this.severity = 2; - break; - default: - this.severity = 0; - break; - } - } - - /** - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("line number: "); //$NON-NLS-1$ - stringBuilder.append(this.lineNbr); - stringBuilder.append("\nfile name: "); //$NON-NLS-1$ - stringBuilder.append(this.fileName); - stringBuilder.append("\nseverity: "); //$NON-NLS-1$ - stringBuilder.append(this.severity); - stringBuilder.append("\nId: "); //$NON-NLS-1$ - stringBuilder.append(this.id); - stringBuilder.append("\nrefered content: "); //$NON-NLS-1$ - stringBuilder.append(this.refferedContent); - stringBuilder.append("\nmessage: "); //$NON-NLS-1$ - stringBuilder.append(this.getMessage()); - stringBuilder.append("\n"); //$NON-NLS-1$ - return stringBuilder.toString(); - } + private static final String[] SECTIONS = SpecfileParser.simpleSections; + + private int lineNbr; + + private int severity; + + private String id; + + private String refferedContent; + + private String message; + + private String fileName; + + /** + * Returns the name of the file rpmlint gives warning for. + * + * @return The file name. + */ + public String getFileName() { + return fileName; + } + + /** + * Sets the name of the file rpmlint gives warning for. + * @param file The File name. + */ + public void setFileName(String file) { + this.fileName = file; + } + + /** + * Returns the line number where the warning appears if rpmlint gives it. + * @return The line number. + */ + public int getLineNbr() { + return lineNbr; + } + + /** + * Sets the line number where the warning appears if rpmlint gives it. + * @param lineNbr The line number. + */ + public void setLineNbr(int lineNbr) { + this.lineNbr = lineNbr; + } + + /** + * The id of the warning. + * @return The id. + */ + public String getId() { + return id; + } + + /** + * Sets the id of the warning. + * @param id The id of the warning. + */ + public void setId(String id) { + this.id = id; + } + + /** + * Returns the message as rpmlint gives it. + * @return The message. + */ + public String getMessage() { + return message; + } + + /** + * Sets the message as rpmlint gives it. + * @param message The raw message. + */ + public void setMessage(String message) { + this.message = message; + } + + /** + * Returns the referred content - section, tag, etc. + * @return The referred content. + */ + public String getRefferedContent() { + return refferedContent; + } + + /** + * Sets the referred content. + * @param refferedContent The referred content. + */ + public void setRefferedContent(String refferedContent) { + for (int i = 0; i < SECTIONS.length; i++) { + if (refferedContent.startsWith(SECTIONS[i])) { + this.refferedContent = refferedContent.trim(); + if (this.refferedContent.equals("")) {//$NON-NLS-1$ + this.refferedContent = SECTIONS[i]; + } + i = SECTIONS.length; + } else { + this.refferedContent = refferedContent; + } + } + } + + /** + * Returns the severity of the rpmlint item. + * + * @return The severity. + */ + public int getSeverity() { + return severity; + } + + /** + * Returns the severity of the rpmlint item. + * + * @param severity The severity of the rpmlint item. + */ + public void setSeverity(String severity) { + severity = severity.replaceAll(":", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$ + switch (severity.charAt(0)) { + case 'I': + this.severity = 0; + break; + case 'W': + this.severity = 1; + break; + case 'E': + this.severity = 2; + break; + default: + this.severity = 0; + break; + } + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("line number: "); //$NON-NLS-1$ + stringBuilder.append(this.lineNbr); + stringBuilder.append("\nfile name: "); //$NON-NLS-1$ + stringBuilder.append(this.fileName); + stringBuilder.append("\nseverity: "); //$NON-NLS-1$ + stringBuilder.append(this.severity); + stringBuilder.append("\nId: "); //$NON-NLS-1$ + stringBuilder.append(this.id); + stringBuilder.append("\nrefered content: "); //$NON-NLS-1$ + stringBuilder.append(this.refferedContent); + stringBuilder.append("\nmessage: "); //$NON-NLS-1$ + stringBuilder.append(this.getMessage()); + stringBuilder.append("\n"); //$NON-NLS-1$ + return stringBuilder.toString(); + } } diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/preferences/PreferenceConstants.java b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/preferences/PreferenceConstants.java index 4b87273931..ca9a5495f4 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/preferences/PreferenceConstants.java +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/preferences/PreferenceConstants.java @@ -15,17 +15,17 @@ package org.eclipse.linuxtools.internal.rpm.rpmlint.preferences; * Constant definitions for rpmlint plug-in preferences */ public class PreferenceConstants { - /** Path to rpmlint executable. */ - public static final String P_RPMLINT_PATH = "RpmlintPath"; //$NON-NLS-1$ - /** Preference to show warnings about using tabs. */ - public static final String P_RPMLINT_TABS = "RpmlintTab"; //$NON-NLS-1$ - /** Preference to show warnings about using spaces. */ - public static final String P_RPMLINT_SPACES = "RpmlintSpaces"; //$NON-NLS-1$ - /** Preference to show warnings about using tabs or spaces. */ - public static final String P_RPMLINT_TABS_AND_SPACES = P_RPMLINT_SPACES; - - /** - * Default path to rpmlint executable (/usr/bin/rpmlint). - */ - public static final String DP_RPMLINT_PATH = "/usr/bin/rpmlint"; //$NON-NLS-1$ + /** Path to rpmlint executable. */ + public static final String P_RPMLINT_PATH = "RpmlintPath"; //$NON-NLS-1$ + /** Preference to show warnings about using tabs. */ + public static final String P_RPMLINT_TABS = "RpmlintTab"; //$NON-NLS-1$ + /** Preference to show warnings about using spaces. */ + public static final String P_RPMLINT_SPACES = "RpmlintSpaces"; //$NON-NLS-1$ + /** Preference to show warnings about using tabs or spaces. */ + public static final String P_RPMLINT_TABS_AND_SPACES = P_RPMLINT_SPACES; + + /** + * Default path to rpmlint executable (/usr/bin/rpmlint). + */ + public static final String DP_RPMLINT_PATH = "/usr/bin/rpmlint"; //$NON-NLS-1$ } diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/MacroInChangelog.java b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/MacroInChangelog.java index 6f7cc3809c..afe333ea87 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/MacroInChangelog.java +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/MacroInChangelog.java @@ -17,29 +17,29 @@ package org.eclipse.linuxtools.internal.rpm.rpmlint.resolutions; */ public class MacroInChangelog extends AReplaceTextResolution { - /** - * The string ID of the rpmlint warning. - */ - public static final String ID = "macro-in-%changelog"; //$NON-NLS-1$ + /** + * The string ID of the rpmlint warning. + */ + public static final String ID = "macro-in-%changelog"; //$NON-NLS-1$ - @Override - public String getOriginalString() { - return "%"; //$NON-NLS-1$ - } + @Override + public String getOriginalString() { + return "%"; //$NON-NLS-1$ + } - @Override - public String getReplaceString() { - return "%%"; //$NON-NLS-1$ - } + @Override + public String getReplaceString() { + return "%%"; //$NON-NLS-1$ + } - @Override - public String getDescription() { - return Messages.MacroInChangelog_0 - + Messages.MacroInChangelog_1; - } + @Override + public String getDescription() { + return Messages.MacroInChangelog_0 + + Messages.MacroInChangelog_1; + } - @Override - public String getLabel() { - return ID; - } + @Override + public String getLabel() { + return ID; + } } diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmBuildrootUsage.java b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmBuildrootUsage.java index 0ddc86d9eb..88c3d37152 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmBuildrootUsage.java +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmBuildrootUsage.java @@ -16,18 +16,18 @@ package org.eclipse.linuxtools.internal.rpm.rpmlint.resolutions; * */ public class RpmBuildrootUsage extends ARemoveLineResolution{ - /** - * The rpmlint ID of the warning. - */ - public static final String ID = "rpm-buildroot-usage"; //$NON-NLS-1$ + /** + * The rpmlint ID of the warning. + */ + public static final String ID = "rpm-buildroot-usage"; //$NON-NLS-1$ - @Override - public String getDescription() { - return Messages.RpmBuildrootUsage_0; - } + @Override + public String getDescription() { + return Messages.RpmBuildrootUsage_0; + } - @Override - public String getLabel() { - return ID; - } + @Override + public String getLabel() { + return ID; + } } diff --git a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmlintMarkerResolutionGenerator.java b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmlintMarkerResolutionGenerator.java index 13dca3efb3..9221b9d5f7 100644 --- a/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmlintMarkerResolutionGenerator.java +++ b/rpm/org.eclipse.linuxtools.rpm.rpmlint/src/org/eclipse/linuxtools/internal/rpm/rpmlint/resolutions/RpmlintMarkerResolutionGenerator.java @@ -24,77 +24,77 @@ import org.eclipse.ui.IMarkerResolutionGenerator2; */ public class RpmlintMarkerResolutionGenerator implements IMarkerResolutionGenerator2 { - /** - * Rpmlint error id atribute name. - */ - public static final String RPMLINT_ERROR_ID = "rpmlintErrorId"; //$NON-NLS-1$ + /** + * Rpmlint error id atribute name. + */ + public static final String RPMLINT_ERROR_ID = "rpmlintErrorId"; //$NON-NLS-1$ - /** - * Rpmlint refered text - */ - public static final String RPMLINT_REFFERED_CONTENT = "rpmlintrefferedContent"; //$NON-NLS-1$ + /** + * Rpmlint refered text + */ + public static final String RPMLINT_REFFERED_CONTENT = "rpmlintrefferedContent"; //$NON-NLS-1$ - @Override - public boolean hasResolutions(IMarker marker) { - String rpmlintErrorId = getRpmlintErrorId(marker); - if (rpmlintErrorId.equals(SetupNotQuiet.ID)) { + @Override + public boolean hasResolutions(IMarker marker) { + String rpmlintErrorId = getRpmlintErrorId(marker); + if (rpmlintErrorId.equals(SetupNotQuiet.ID)) { return true; - } else if (rpmlintErrorId.equals(PatchNotApplied.ID)) { - return true; - } else if (rpmlintErrorId.equals(NoBuildSection.ID)){ - return true; - } else if (rpmlintErrorId.equals(MacroInChangelog.ID)){ - return true; - } else if (rpmlintErrorId.equals(RpmBuildrootUsage.ID)){ - return true; - } else if (rpmlintErrorId.equals(HardcodedPrefixTag.ID)){ - return true; - } else if (rpmlintErrorId.equals(HardcodedPackagerTag.ID)){ - return true; - } else if (rpmlintErrorId.equals(NoPrepSection.ID)){ - return true; - } else if (rpmlintErrorId.equals(NoInstallSection.ID)){ - return true; - } + } else if (rpmlintErrorId.equals(PatchNotApplied.ID)) { + return true; + } else if (rpmlintErrorId.equals(NoBuildSection.ID)){ + return true; + } else if (rpmlintErrorId.equals(MacroInChangelog.ID)){ + return true; + } else if (rpmlintErrorId.equals(RpmBuildrootUsage.ID)){ + return true; + } else if (rpmlintErrorId.equals(HardcodedPrefixTag.ID)){ + return true; + } else if (rpmlintErrorId.equals(HardcodedPackagerTag.ID)){ + return true; + } else if (rpmlintErrorId.equals(NoPrepSection.ID)){ + return true; + } else if (rpmlintErrorId.equals(NoInstallSection.ID)){ + return true; + } - return false; - } + return false; + } - @Override - public IMarkerResolution[] getResolutions(IMarker marker) { - List<IMarkerResolution> resolutions = new ArrayList<>(); - String rpmlintErrorId = getRpmlintErrorId(marker); - if (rpmlintErrorId.equals(SetupNotQuiet.ID)) { - resolutions.add(new SetupNotQuiet()); - } else if (rpmlintErrorId.equals(PatchNotApplied.ID)) { - resolutions.add(new PatchNotApplied()); - } else if (rpmlintErrorId.equals(NoBuildSection.ID)){ - resolutions.add(new NoBuildSection()); - } else if (rpmlintErrorId.equals(MacroInChangelog.ID)){ - resolutions.add(new MacroInChangelog()); - } else if (rpmlintErrorId.equals(RpmBuildrootUsage.ID)){ - resolutions.add(new RpmBuildrootUsage()); - } else if (rpmlintErrorId.equals(HardcodedPrefixTag.ID)){ - resolutions.add(new HardcodedPrefixTag()); - } else if (rpmlintErrorId.equals(HardcodedPackagerTag.ID)){ - resolutions.add(new HardcodedPackagerTag()); - } else if (rpmlintErrorId.equals(NoPrepSection.ID)){ - resolutions.add(new NoPrepSection()); - } else if (rpmlintErrorId.equals(NoInstallSection.ID)){ - resolutions.add(new NoInstallSection()); - } + @Override + public IMarkerResolution[] getResolutions(IMarker marker) { + List<IMarkerResolution> resolutions = new ArrayList<>(); + String rpmlintErrorId = getRpmlintErrorId(marker); + if (rpmlintErrorId.equals(SetupNotQuiet.ID)) { + resolutions.add(new SetupNotQuiet()); + } else if (rpmlintErrorId.equals(PatchNotApplied.ID)) { + resolutions.add(new PatchNotApplied()); + } else if (rpmlintErrorId.equals(NoBuildSection.ID)){ + resolutions.add(new NoBuildSection()); + } else if (rpmlintErrorId.equals(MacroInChangelog.ID)){ + resolutions.add(new MacroInChangelog()); + } else if (rpmlintErrorId.equals(RpmBuildrootUsage.ID)){ + resolutions.add(new RpmBuildrootUsage()); + } else if (rpmlintErrorId.equals(HardcodedPrefixTag.ID)){ + resolutions.add(new HardcodedPrefixTag()); + } else if (rpmlintErrorId.equals(HardcodedPackagerTag.ID)){ + resolutions.add(new HardcodedPackagerTag()); + } else if (rpmlintErrorId.equals(NoPrepSection.ID)){ + resolutions.add(new NoPrepSection()); + } else if (rpmlintErrorId.equals(NoInstallSection.ID)){ + resolutions.add(new NoInstallSection()); + } - return resolutions.toArray(new IMarkerResolution[resolutions.size()]); - } + return resolutions.toArray(new IMarkerResolution[resolutions.size()]); + } - /** - * Return the rpmlint error id attribute for the specified marker. - * - * @param marker The marker to check. - * @return The rpmlint error id or <code>""</code> if none. - */ - private static String getRpmlintErrorId(IMarker marker) { - return marker.getAttribute(RPMLINT_ERROR_ID, ""); //$NON-NLS-1$ - } + /** + * Return the rpmlint error id attribute for the specified marker. + * + * @param marker The marker to check. + * @return The rpmlint error id or <code>""</code> if none. + */ + private static String getRpmlintErrorId(IMarker marker) { + return marker.getAttribute(RPMLINT_ERROR_ID, ""); //$NON-NLS-1$ + } } |