Skip to content

Commit

Permalink
Added formattig and styling (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvsonagara authored Jun 19, 2023
1 parent 23a93b8 commit 92163b0
Show file tree
Hide file tree
Showing 21 changed files with 1,041 additions and 259 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# - slack/notify:
# event: pass
# template: basic_success_1
- run: ./gradlew clean bootJar
- run: ./gradlew clean bootJar
- aws-ecr/build-and-push-image:
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
Expand All @@ -33,7 +33,7 @@ jobs:
repo: ph-es-importer
repo-scan-on-push: true
role-arn: arn:aws:iam::419830066942:role/CustomAdmin
tag: latest
tag: latest
# - run: ./gradlew cucumberCli
# run tests! Slack Success/Fail Notification Step
#- run: ./gradlew test
Expand All @@ -44,4 +44,3 @@ workflows:
context:
- AWS
- slack

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Please make sure these boxes are checked before submitting your pull request - thanks!

- [ ] Design related bullet points or design document link related to this PR added in the description above.
- [ ] Design related bullet points or design document link related to this PR added in the description above.

- [ ] Updated corresponding Postman Collection or Api documentation for the changes in this PR.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# payment-hub-ee
Payment Hub Enterprise Edition middleware for integration to real-time payment systems.
Payment Hub Enterprise Edition middleware for integration to real-time payment systems.

#Auto-trigger
127 changes: 127 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {
id 'maven-publish'
id 'org.springframework.boot' version '2.6.2'
id 'eclipse'
id 'checkstyle'
id 'com.diffplug.spotless' version '6.19.0'
}

repositories {
Expand All @@ -20,6 +22,28 @@ repositories {
}
}

apply plugin:'com.diffplug.spotless'
spotless {
format 'misc', {
target '**/*.md', '**/*.properties', '**/.gitignore', '**/.openapi-generator-ignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**', '**/gradlew.bat', '**/licenses/**', '**/banner.txt', '.vscode/**'
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}

groovyGradle {
target '*.gradle', '**/*.gradle'
targetExclude '**/build/**'
greclipse()
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}

lineEndings 'UNIX'
}

dependencies {
implementation 'io.zeebe:zeebe-elasticsearch-exporter:0.24.6'
implementation 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.6.0'
Expand All @@ -29,6 +53,109 @@ dependencies {
implementation 'org.json:json:20190722'
testImplementation 'junit:junit:4.13'
implementation 'org.apache.commons:commons-text:1.10.0'
checkstyle 'com.puppycrawl.tools:checkstyle:10.9.3'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.44.1'
implementation 'com.diffplug.gradle.spotless:spotless:2.4.1'
implementation 'com.diffplug.spotless:spotless-plugin-gradle:6.17.0'
}

configure(this) {
// NOTE: order matters!
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
configurations {
implementation.setCanBeResolved(true)
api.setCanBeResolved(true)
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
"-Xlint:unchecked",
"-Xlint:cast",
"-Xlint:auxiliaryclass",
"-Xlint:deprecation",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:exports",
"-Xlint:fallthrough",
"-Xlint:finally",
"-Xlint:module",
"-Xlint:opens",
"-Xlint:options",
"-Xlint:overloads",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:removal",
"-Xlint:requires-automatic",
"-Xlint:requires-transitive-automatic",
"-Xlint:try",
"-Xlint:varargs",
"-Xlint:preview",
"-Xlint:static",
// -Werror needs to be disabled because EclipseLink's static weaving doesn't generate warning-free code
// and during an IntelliJ recompilation, it fails
//"-Werror",
"-Xmaxwarns",
1500,
"-Xmaxerrs",
1500
]
options.deprecation = true
}
// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
java {
targetExclude '**/build/**', '**/bin/**', '**/out/**'
importOrder() //sort imports alphabetically
removeUnusedImports()
eclipse().configFile "$rootDir/config/es-formatter.xml"
endWithNewline()
trimTrailingWhitespace()
// Enforce style modifier order
custom 'Modifier ordering', {
def modifierRanking = [
public : 1,
protected : 2,
private : 3,
abstract : 4,
default : 5,
static : 6,
final : 7,
transient : 8,
volatile : 9,
synchronized: 10,
native : 11,
strictfp : 12]
// Find any instance of multiple modifiers. Lead with a non-word character to avoid
// accidental matching against for instance, "an alternative default value"
it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
// Do not replace the leading non-word character. Identify the modifiers
it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
// Sort the modifiers according to the ranking above
it.split().sort({ modifierRanking[it] }).join(' ') + ' '
}
)
}
)
}
}
lineEndings 'UNIX'
}
// If we are running Gradle within Eclipse to enhance classes,
// set the classes directory to point to Eclipse's default build directory
if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') {
sourceSets.main.java.outputDir = file("$projectDir/bin/main")
}
// Configuration for the Checkstyle plugin
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:10.3.1'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.42.0'
}
}

group = 'org.mifos'
Expand Down
Loading

0 comments on commit 92163b0

Please sign in to comment.