Skip to content
Draft
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# gradle files
.gradle
build

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# IDEA project files
.idea
40 changes: 40 additions & 0 deletions PMDRuleSet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0"?>

<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
My custom rules
</description>

<rule ref="category/java/bestpractices.xml">
<exclude name="SystemPrintln"/>
</rule>

<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="OnlyOneReturn"/>
</rule>

<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter"/>
</rule>

<rule ref="category/java/errorprone.xml" />

<rule ref="category/java/codestyle.xml/LongVariable">
<properties>
<property name="minimum" value="35" />
</properties>
</rule>

<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts">
<properties>
<property name="maximumAsserts" value="2" />
</properties>
</rule>


</ruleset>
55 changes: 55 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'pmd'

group 'com.github'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
implementation('net.sourceforge.pmd:pmd-java:6.29.0')
implementation('info.picocli:picocli:4.5.2')
implementation('com.opencsv:opencsv:5.2')

testImplementation(platform('org.junit:junit-bom:5.7.0'))
testImplementation('org.junit.jupiter:junit-jupiter')

testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
}

pmd {
consoleOutput = true
ruleSetFiles = files("PMDRuleSet.xml")
toolVersion = "6.29.0"
}

test {
useJUnitPlatform()
}

application {
mainClassName = 'com.github.emcat.Emcat'
applicationDefaultJvmArgs = ["--enable-preview"]
}

run{
standardInput = System.in
}

sourceCompatibility = 14
targetCompatibility = 14

tasks.withType(JavaCompile) {
options.compilerArgs += '--enable-preview'
}

tasks.withType(Test) {
jvmArgs += "--enable-preview"
}

tasks.withType(JavaExec) {
jvmArgs += '--enable-preview'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading