Skip to content

Commit

Permalink
Merge branch 'next' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLooman committed Feb 29, 2024
2 parents e66f748 + 25ebc12 commit 4655f3b
Show file tree
Hide file tree
Showing 483 changed files with 45,259 additions and 45,626 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ root = true

[*.java]
charset = utf-8
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
Expand Down
25 changes: 10 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
{
"editor.detectIndentation": false,
"editor.renderWhitespace": "selection",
"editor.rulers": [100, 120],
"editor.tabSize": 4,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"editor.renderWhitespace": "selection",
"editor.rulers": [120],
"editor.tabSize": 4,
"java.autobuild.enabled": false,
"java.configuration.maven.notCoveredPluginExecutionSeverity": "ignore",
"java.configuration.updateBuildConfiguration": "automatic",
"java.completion.importOrder": [
"com",
"java",
"javax",
"nl",
"org"
],
"editor.detectIndentation": false,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"java.autobuild.enabled": false,
"java.checkstyle.version": "10.13.0",
"java.checkstyle.configuration": "/google_checks.xml",
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.maven.notCoveredPluginExecutionSeverity": "ignore",
"java.configuration.updateBuildConfiguration": "automatic",
"java.debug.settings.showLogicalStructure": true,
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"sonarlint.connectedMode.project": {
"connectionId": "SonarCloud",
"projectKey": "StevenLooman_magik-tools"
},
"java.debug.settings.showLogicalStructure": true,
}
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

0.9.1 (unreleased)

- Add base functionality to apply fixes from magik-lint.

0.9.0 (2024-02-26)

- Support configurable libs dirs.
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,23 @@ A debug adapter for Smallworld 5/Magik is available in the [`magik-debug-adapter
You can build the plugin using maven, like so:

```shell
$ mvn clean package
$ mvn clean verify test package
[INFO] Scanning for projects...
...
```

Building without running tests:

```shell
$ mvn -Dmaven.test.skip=true clean verify test package
[INFO] Scanning for projects...
...
```

Auto-formatting of Java sources:

```shell
$ mvn spotless:apply
[INFO] Scanning for projects...
...
```
Expand Down
5 changes: 5 additions & 0 deletions magik-checks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<artifactId>slf4j-jdk14</artifactId>
</dependency>

<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,82 +39,82 @@
import nl.ramsolutions.sw.magik.checks.checks.VariableNamingCheck;
import nl.ramsolutions.sw.magik.checks.checks.WarnedCallCheck;

/**
* Check list.
*/
/** Check list. */
public final class CheckList {

@SuppressWarnings("checkstyle:JavadocVariable")
public static final String REPOSITORY_KEY = "magik";
@SuppressWarnings("checkstyle:JavadocVariable")
public static final String REPOSITORY_KEY = "magik";

@SuppressWarnings("checkstyle:JavadocVariable")
public static final String PROFILE_DIR = "nl/ramsolutions/sw/sonar/l10n/magik/rules";
@SuppressWarnings("checkstyle:JavadocVariable")
public static final String PROFILE_DIR = "nl/ramsolutions/sw/sonar/l10n/magik/rules";

@SuppressWarnings("checkstyle:JavadocVariable")
public static final String PROFILE_LOCATION = PROFILE_DIR + "/Sonar_way_profile.json";
@SuppressWarnings("checkstyle:JavadocVariable")
public static final String PROFILE_LOCATION = PROFILE_DIR + "/Sonar_way_profile.json";

private CheckList() {
}
private CheckList() {}

/**
* Get the list of {@link MagikCheck}s.
* @return List of {@link MagikCheck}s.
*/
public static List<Class<? extends MagikCheck>> getChecks() {
return List.of(
CommentedCodeCheck.class,
DuplicateMethodInFileCheck.class,
EmptyBlockCheck.class,
ExemplarSlotCountCheck.class,
FileMethodCountCheck.class,
FileNotInLoadListCheck.class,
ForbiddenCallCheck.class,
ForbiddenGlobalUsageCheck.class,
ForbiddenInheritanceCheck.class,
FormattingCheck.class,
HidesVariableCheck.class,
ImportMissingDefinitionCheck.class,
LhsRhsComparatorEqualCheck.class,
LineLengthCheck.class,
LocalImportProcedureCheck.class,
MethodComplexityCheck.class,
MethodLineCountCheck.class,
NoSelfUseCheck.class,
NoStatementAfterBodyExitCheck.class,
ParameterCountCheck.class,
ScopeCountCheck.class,
SimplifyIfCheck.class,
SizeZeroEmptyCheck.class,
SwMethodDocCheck.class,
SyntaxErrorCheck.class,
TodoCommentCheck.class,
TrailingWhitespaceCheck.class,
TypeDocCheck.class,
UndefinedVariableCheck.class,
UnusedVariableCheck.class,
UseValueCompareCheck.class,
VariableCountCheck.class,
VariableDeclarationUsageDistanceCheck.class,
VariableNamingCheck.class,
WarnedCallCheck.class);
}
/**
* Get the list of {@link MagikCheck}s.
*
* @return List of {@link MagikCheck}s.
*/
public static List<Class<? extends MagikCheck>> getChecks() {
return List.of(
CommentedCodeCheck.class,
DuplicateMethodInFileCheck.class,
EmptyBlockCheck.class,
ExemplarSlotCountCheck.class,
FileMethodCountCheck.class,
FileNotInLoadListCheck.class,
ForbiddenCallCheck.class,
ForbiddenGlobalUsageCheck.class,
ForbiddenInheritanceCheck.class,
FormattingCheck.class,
HidesVariableCheck.class,
ImportMissingDefinitionCheck.class,
LhsRhsComparatorEqualCheck.class,
LineLengthCheck.class,
LocalImportProcedureCheck.class,
MethodComplexityCheck.class,
MethodLineCountCheck.class,
NoSelfUseCheck.class,
NoStatementAfterBodyExitCheck.class,
ParameterCountCheck.class,
ScopeCountCheck.class,
SimplifyIfCheck.class,
SizeZeroEmptyCheck.class,
SwMethodDocCheck.class,
SyntaxErrorCheck.class,
TodoCommentCheck.class,
TrailingWhitespaceCheck.class,
TypeDocCheck.class,
UndefinedVariableCheck.class,
UnusedVariableCheck.class,
UseValueCompareCheck.class,
VariableCountCheck.class,
VariableDeclarationUsageDistanceCheck.class,
VariableNamingCheck.class,
WarnedCallCheck.class);
}

/**
* Get the {@link MagikCheck}s which have a {@link MagikCheckFixer}.
* @return
*/
public static Map<Class<? extends MagikCheck>, List<Class<? extends MagikCheckFixer>>> getFixers() {
return Map.of();
}

/**
* Get {@link MagikCheck}s which are disabled by default.
* @return List of {@link MagikCheck}s.
*/
public static List<Class<? extends MagikCheck>> getDisabledByDefaultChecks() {
return getChecks().stream()
.filter(checkClass -> checkClass.getAnnotation(DisabledByDefault.class) != null)
.collect(Collectors.toList());
}
/**
* Get the {@link MagikCheck}s which have a {@link MagikCheckFixer}.
*
* @return Map of {@link MagikCheck}s and their {@link MagikCheckFixer}s.
*/
public static Map<Class<? extends MagikCheck>, List<Class<? extends MagikCheckFixer>>>
getFixers() {
return Map.of();
}

/**
* Get {@link MagikCheck}s which are disabled by default.
*
* @return List of {@link MagikCheck}s.
*/
public static List<Class<? extends MagikCheck>> getDisabledByDefaultChecks() {
return getChecks().stream()
.filter(checkClass -> checkClass.getAnnotation(DisabledByDefault.class) != null)
.collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to mark MagikCheck as disabled by default.
*/
/** Annotation to mark MagikCheck as disabled by default. */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface DisabledByDefault {

}
public @interface DisabledByDefault {}
Loading

0 comments on commit 4655f3b

Please sign in to comment.