Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #440: resolves CustomDeclarationOrder #450

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions config/sevntu_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<suppress checks="LineLengthExtended"
files=".*"
/>
<suppress checks="CustomDeclarationOrder"
files=".*"
/>
<suppress checks="ConstructorWithoutParams"
files=".*"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ public class Auditor {
/** The check configuration the auditor uses. */
private final ICheckConfiguration mCheckConfiguration;

/** The progress monitor. */
private IProgressMonitor mMonitor;

/** Map containing the file resources to audit. */
private final Map<String, IFile> mFiles = new HashMap<>();

/** Reference to the file buffer manager. */
private final ITextFileBufferManager mFileBufferManager = FileBuffers.getTextFileBufferManager();

/** The progress monitor. */
private IProgressMonitor mMonitor;

/** Add the check rule name to the message. */
private boolean mAddRuleName = false;

/** Add the check module id to the message. */
private boolean mAddModuleId = false;

/** Reference to the file buffer manager. */
private final ITextFileBufferManager mFileBufferManager = FileBuffers.getTextFileBufferManager();

/**
* Creates an auditor.
*
Expand Down Expand Up @@ -233,15 +233,6 @@ private class CheckstyleAuditListener implements AuditListener {
/** the project. */
private final IProject mProject;

/** The file currently being checked. */
private IResource mResource;

/** Document model of the current file. */
private IDocument mDocument;

/** internal counter used to time to actualisation of the monitor. */
private int mMonitorCounter;

/** map containing the marker data. */
private final Map<String, Object> mMarkerAttributes = new HashMap<>();

Expand All @@ -251,6 +242,15 @@ private class CheckstyleAuditListener implements AuditListener {
/** the max amount of markers per resource. */
private final int mMarkerLimit;

/** The file currently being checked. */
private IResource mResource;

/** Document model of the current file. */
private IDocument mDocument;

/** internal counter used to time to actualisation of the monitor. */
private int mMonitorCounter;

/** the count of markers generated for the current resource. */
private int mMarkerCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public final class CheckConfigurationFactory {
/** Name of the actual config file version. */
private static final String VERSION_5_0_0 = "5.0.0"; //$NON-NLS-1$

// -@cs[CustomDeclarationOrder] until sevntu.checkstyle/issues/415
/** The current file version. */
protected static final String CURRENT_CONFIG_FILE_FORMAT_VERSION = VERSION_5_0_0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Known issue.


Expand All @@ -96,6 +97,16 @@ public final class CheckConfigurationFactory {
private CheckConfigurationFactory() {
}

/**
* Creates a new working set from the existing configurations.
*
* @return a new configuration working set
*/
public static ICheckConfigurationWorkingSet newWorkingSet() {
return new GlobalCheckConfigurationWorkingSet(sConfigurations, getDefaultCheckConfiguration(),
sDefaultBuiltInConfig);
}

/**
* Get an <code>CheckConfiguration</code> instance by its name.
*
Expand Down Expand Up @@ -141,16 +152,6 @@ public static ICheckConfiguration getDefaultCheckConfiguration() {
}
}

/**
* Creates a new working set from the existing configurations.
*
* @return a new configuration working set
*/
public static ICheckConfigurationWorkingSet newWorkingSet() {
return new GlobalCheckConfigurationWorkingSet(sConfigurations, getDefaultCheckConfiguration(),
sDefaultBuiltInConfig);
}

/**
* Refreshes the check configurations from the persistent store.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public class Module implements Cloneable {
// attributes
//

/** the custom messages for this module. */
private final Map<String, String> mCustomMessages = new HashMap<>();

/** map containing unknown custom metadata of the module. */
private final Map<String, String> mCustomMetaData = new HashMap<>();

/** the name of the module. */
private String mName;

Expand All @@ -55,18 +61,12 @@ public class Module implements Cloneable {
/** the id of the module. */
private String id;

/** the custom messages for this module. */
private final Map<String, String> mCustomMessages = new HashMap<>();

/** the severity level. */
private Severity mSeverityLevel = Severity.inherit;

/** the last severity level before setting to ignored. */
private Severity mLastEnabledSeverity;

/** map containing unknown custom metadata of the module. */
private final Map<String, String> mCustomMetaData = new HashMap<>();

//
// constructors
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ public abstract class ConfigurationType implements IConfigurationType {
/** Flag if configuration file is configurable. */
private boolean mIsConfigurable;

/**
* Returns the URL of the checkstyle configuration file. Implementors are not expected to open any
* connection to the URL.
*
* @param checkConfiguration
* the actual check configuration
* @return the URL of the checkstyle configuration file
* @throws IOException
* error while resolving the url
*/
protected abstract URL resolveLocation(ICheckConfiguration checkConfiguration) throws IOException;

@Override
public void initialize(String name, String internalName, String definingPluginId,
boolean creatable, boolean editable, boolean configurable) {
Expand Down Expand Up @@ -146,18 +158,6 @@ public CheckstyleConfigurationFile getCheckstyleConfiguration(
return data;
}

/**
* Returns the URL of the checkstyle configuration file. Implementors are not expected to open any
* connection to the URL.
*
* @param checkConfiguration
* the actual check configuration
* @return the URL of the checkstyle configuration file
* @throws IOException
* error while resolving the url
*/
protected abstract URL resolveLocation(ICheckConfiguration checkConfiguration) throws IOException;

protected byte[] getAdditionPropertiesBundleBytes(URL checkConfigURL) {

String location = checkConfigURL.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public class StandardPropertyResolver implements PropertyResolver, IContextAware
/** constant for the config_loc variable. */
private static final String CONFIG_LOC = "config_loc"; //$NON-NLS-1$

/** the context project. */
private IProject mProject;

/** the location of the configuration file. */
private final String mConfigLocation;

/** the context project. */
private IProject mProject;

/**
* Creates the BuiltInPropertyResolver.
*
Expand Down
Loading