walkmod-metricstream-plugin

Walkmod plugin to automatically apply Metricstream conventions

License

License

Categories

Categories

Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

com.metricstream
ArtifactId

ArtifactId

walkmod-metricstream-plugin
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

walkmod-metricstream-plugin
Walkmod plugin to automatically apply Metricstream conventions
Project URL

Project URL

https://github.com/walkmod/walkmod-metricstream-plugin
Source Code Management

Source Code Management

https://github.com/walkmod/walkmod-metricstream-plugin

Download walkmod-metricstream-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.metricstream/walkmod-metricstream-plugin/ -->
<dependency>
    <groupId>com.metricstream</groupId>
    <artifactId>walkmod-metricstream-plugin</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.metricstream/walkmod-metricstream-plugin/
implementation 'com.metricstream:walkmod-metricstream-plugin:1.0.1'
// https://jarcasting.com/artifacts/com.metricstream/walkmod-metricstream-plugin/
implementation ("com.metricstream:walkmod-metricstream-plugin:1.0.1")
'com.metricstream:walkmod-metricstream-plugin:jar:1.0.1'
<dependency org="com.metricstream" name="walkmod-metricstream-plugin" rev="1.0.1">
  <artifact name="walkmod-metricstream-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.metricstream', module='walkmod-metricstream-plugin', version='1.0.1')
)
libraryDependencies += "com.metricstream" % "walkmod-metricstream-plugin" % "1.0.1"
[com.metricstream/walkmod-metricstream-plugin "1.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.walkmod : javalang jar [4.5.0, 5.0)
org.walkmod : walkmod-core jar [2.0.0,3.0.0)

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

walkmod-metricstream-plugin

Build Status

This is a walkmod plugin to apply all MetricStream conventions. It has been fully implemented by the MetricStream company and maintained by Walkmod. Currently, the supported rules are:

- AddCurlyBrackets : adds  { } inside the "if", "else", "for", "do", "while", "switch", and "foreach" to encapsulate statements.
- AddSwitchDefaultCase: adds an empty default case into switch statements.
- ArrayDesignatorOnType: to transform Type variable[] into Type[] variable
- PrimitiveInstantiationForToString: to transform new Integer(5).toString() into Integer.valueOf(5);
- RemoveCodeComment: To remove comments that only contains code.
- RemoveEmptyMethod: To remove empty methods.
- RemoveEmptyStatement: To remove empty statements (statements with just ';').
- RemoveLiteralBoolean: To simplify boolean expressions
- StaticInitializedFieldToFinal: Adds the final modifier to all the static methods.
- StringCheckOnLeft: If the "equals" or "equalsIgnoreCase" method is invoked and the argument is an String literal, this string literal is becomes the implicit object.
- UseCollectionIsEmpty: Transforms expressions that checks the collection size to see if it is empty to the method isEmpty().
- UseStringEquals: If strings are compared using "==" the expression is transformed to use equals() method.
- VariableImmediatelyReturned: if the return statement is a variable previously declared, this declaration is removed and the returned value is the initialization value of this variable.

Usage

1) Verify that your walkmod version is > = 2.2.0

2) Execute the ´walkmod add´ command for the list of the desired subset of conventions.

walkmod add com.metricstream:metricstream:AddCurlyBrackets

3) Now, You see the results, executing:

walkmod apply

Or, alternatively, you can also check which would be the modified classes typing:

walkmod check

Contributing

If you want to hack on this, fork it, improve it and send me a pull request.

To get started using it, just clone it and call mvn install.

com.metricstream

walkmod

Versions

Version
1.0.1
1.0.0