Skip to content

Commit

Permalink
Fixes for diktat check workflows (#613)
Browse files Browse the repository at this point in the history
### What's done:
* Use config from release for check by release version
* Check all modules in snapshot check
* Fixing code style
  • Loading branch information
petertrr authored Dec 7, 2020
1 parent 4e16a72 commit ecfee94
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/diktat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3
with:
# set this to 0 to fetch all tags too and be able to use them later
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
Expand All @@ -23,5 +26,12 @@ jobs:
key: ${{ runner.os }}-maven-diktat-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-diktat-
- name: Substitute diktat config with the one from the latest release
# fixme: can be done from the fetched repo without additional network request
run: |
git fetch --tags
LATEST_TAG=$(git describe --tags --abbrev=0)
DIKTAT_CONFIG=diktat-analysis.yml
wget -O $DIKTAT_CONFIG https://raw.githubusercontent.com/cqfn/diKTat/$LATEST_TAG/$DIKTAT_CONFIG
- name: Run diktat via maven plugin
run: mvn -B diktat:check@diktat -DskipPluginMarker
5 changes: 1 addition & 4 deletions .github/workflows/diktat_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ jobs:
mvn -B versions:set-property -Dproperty=diktat-check.version -DnewVersion=${{ env.BASE_VERSION }}-pre
- name: Run diktat snapshot via ktlint
run: |
mvn -B diktat:check@diktat --pl diktat-common || echo "LintErrors encountered"
mvn -B diktat:check@diktat --pl diktat-maven-plugin || echo "LintErrors encountered"
mvn -B diktat:check@diktat --pl diktat-test-framework || echo "LintErrors encountered"
mvn -B diktat:check@diktat --pl diktat-rules
mvn -B diktat:check@diktat
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ open class DiktatJavaExecTaskBase @Inject constructor(
@get:Internal
internal val ignoreFailuresProp: Property<Boolean> = project.objects.property(Boolean::class.javaObjectType)

/**
* Whether diktat should be executed via JavaExec or not.
*/
@get:Internal
internal var shouldRun = true

Expand All @@ -51,7 +54,8 @@ open class DiktatJavaExecTaskBase @Inject constructor(
if (diktatExtension.debug) {
add("--debug")
}
diktatExtension.inputs
diktatExtension
.inputs
.also {
if (it.isEmpty) {
/*
Expand Down

0 comments on commit ecfee94

Please sign in to comment.