Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the package name to the new one #1687

Merged
merged 9 commits into from
Jun 9, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = true
ij_kotlin_import_nested_classes = false
ij_kotlin_imports_layout = android.**,androidx.**,com.android.**,org.cqfn.diktat.**,*,java.**,javax.**,kotlin.**,kotlinx.**,^
ij_kotlin_imports_layout = android.**,androidx.**,com.android.**,com.saveourtool.diktat.**,*,java.**,javax.**,kotlin.**,kotlinx.**,^
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 2
ij_kotlin_keep_blank_lines_in_code = 2
Expand Down
63 changes: 33 additions & 30 deletions .github/workflows/diktat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,36 @@ jobs:
security-events: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
diktatCheck
mergeDiktatReports
-Pdiktat.githubActions=true
-Pdetekt.multiplatform.disabled=true
--build-cache
--continue
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF report to Github
uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: build/reports/diktat/diktat-merged.sarif
- name: Upload SARIF artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: sarif-reports
path: "**/build/reports/diktat"
retention-days: 1
- name: This action is disabled until the release 2.0.0
run: |
echo "This action is disabled until the release 2.0.0"
# - uses: actions/checkout@v3
# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: 11
# distribution: temurin
# - uses: gradle/gradle-build-action@v2
# with:
# gradle-version: wrapper
# arguments: |
# diktatCheck
# mergeDiktatReports
# -Pdiktat.githubActions=true
# -Pdetekt.multiplatform.disabled=true
# --build-cache
# --continue
# -PgprUser=${{ github.actor }}
# -PgprKey=${{ secrets.GITHUB_TOKEN }}
# - name: Upload SARIF report to Github
# uses: github/codeql-action/upload-sarif@v2
# if: ${{ always() }}
# with:
# sarif_file: build/reports/diktat/diktat-merged.sarif
# - name: Upload SARIF artifacts
# uses: actions/upload-artifact@v3
# if: ${{ failure() }}
# with:
# name: sarif-reports
# path: "**/build/reports/diktat"
# retention-days: 1
24 changes: 22 additions & 2 deletions .github/workflows/diktat_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,34 @@ jobs:
:diktat-gradle-plugin:publishToMavenLocal
:generateLibsForDiktatSnapshot
-x detekt
-x diktatCheck
-x test
# FixMe: return after 2.0.0
# -x diktatCheck

- name: 'Copy files and set flags'
run: |
echo "DIKTAT_SNAPSHOT=1" >> $GITHUB_ENV
mv gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts

- name: 'Override <gradle/libs.versions.toml>'
run: |
mv gradle/libs.versions.toml gradle/libs.versions.toml_current
mv build/diktat-snapshot/libs.versions.toml_snapshot gradle/libs.versions.toml

# FixMe: remove after 2.0.0
- name: 'Small hack to inject implementation and to run diktat properly from snapshot'
run: |
#!/bin/bash
file_path=gradle/plugins/build.gradle.kts
string_to_insert='
dependencies {
implementation(libs.diktat.gradle.plugin) {
exclude("io.github.detekt.sarif4k", "sarif4k")
}
}'

echo $string_to_insert >> $file_path

# copied from .github/workflows/diktat.yml
- uses: gradle/gradle-build-action@v2
with:
Expand All @@ -70,8 +90,8 @@ jobs:
mergeDiktatReports
-Pdiktat.githubActions=true
-Pdetekt.multiplatform.disabled=true
--build-cache
--continue
--build-cache
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF report to Github
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![codecov](https://codecov.io/gh/saveourtool/diKTat/branch/master/graph/badge.svg)](https://codecov.io/gh/saveourtool/diKTat)

[![Releases](https://img.shields.io/github/v/release/saveourtool/diKTat)](https://github.com/saveourtool/diKTat/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.cqfn.diktat/diktat-rules)](https://mvnrepository.com/artifact/org.cqfn.diktat)
[![Maven Central](https://img.shields.io/maven-central/v/com.saveourtool.diktat/diktat-rules)](https://mvnrepository.com/artifact/com.saveourtool.diktat)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgit.luolix.top%2Fsaveourtool%2FdiKTat.svg?type=shield)](https://app.fossa.com/projects/git%2Bgit.luolix.top%2Fsaveourtool%2FdiKTat?ref=badge_shield)
[![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/diktat_help)

Expand Down Expand Up @@ -60,7 +60,7 @@ Main features of diktat are the following:

**OR** use `curl`:
```console
$ curl -sSLO https://github.com/saveourtool/diKTat/releases/download/v1.2.5/diktat-1.2.5.jar
$ curl -sSLO https://github.com/saveourtool/diKTat/releases/download/v1.2.5/diktat-1.2.5.jar && chmod a+x diktat
```

### Run diKTat
Expand Down Expand Up @@ -89,7 +89,7 @@ If you use it and encounter any problems, feel free to open issues on [github](h

```xml
<plugin>
<groupId>org.cqfn.diktat</groupId>
<groupId>com.saveourtool.diktat</groupId>
<artifactId>diktat-maven-plugin</artifactId>
<version>${diktat.version}</version>
<executions>
Expand Down Expand Up @@ -182,7 +182,7 @@ This plugin is available since version 0.1.5. You can see how the plugin is conf

```kotlin
plugins {
id("org.cqfn.diktat.diktat-gradle-plugin") version "1.2.5"
nulls marked this conversation as resolved.
Show resolved Hide resolved
id("com.saveourtool.diktat.diktat-gradle-plugin") version "1.2.5"
}
```

Expand All @@ -193,11 +193,11 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.cqfn.diktat:diktat-gradle-plugin:1.2.5")
classpath("com.saveourtool.diktat:diktat-gradle-plugin:1.2.5")
}
}

apply(plugin = "org.cqfn.diktat.diktat-gradle-plugin")
apply(plugin = "com.saveourtool.diktat.diktat-gradle-plugin")
```

You can then configure diktat using `diktat` extension:
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import org.cqfn.diktat.buildutils.configureSigning
import com.saveourtool.diktat.buildutils.configureSigning
import org.jetbrains.kotlin.incremental.createDirectory
import java.nio.file.Files

@Suppress("DSL_SCOPE_VIOLATION", "RUN_IN_SCRIPT") // https://github.com/gradle/gradle/issues/22797
plugins {
id("org.cqfn.diktat.buildutils.versioning-configuration")
id("org.cqfn.diktat.buildutils.git-hook-configuration")
id("org.cqfn.diktat.buildutils.code-quality-convention")
id("org.cqfn.diktat.buildutils.publishing-configuration")
id("com.saveourtool.diktat.buildutils.versioning-configuration")
id("com.saveourtool.diktat.buildutils.git-hook-configuration")
id("com.saveourtool.diktat.buildutils.code-quality-convention")
id("com.saveourtool.diktat.buildutils.publishing-configuration")
alias(libs.plugins.talaiot.base)
java
`maven-publish`
Expand Down
2 changes: 1 addition & 1 deletion detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,4 @@ style:
WildcardImport:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
excludeImports: ['org.cqfn.diktat.ruleset.utils.*', 'java.util.*', 'kotlinx.android.synthetic.*', 'kotlinx.serialization']
excludeImports: ['com.saveourtool.diktat.ruleset.utils.*', 'java.util.*', 'kotlinx.android.synthetic.*', 'kotlinx.serialization']
6 changes: 3 additions & 3 deletions diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
enabled: true
configuration:
# put your package name here - it will be autofixed and checked
domainName: org.cqfn.diktat
domainName: com.saveourtool.diktat
# testDirs: test
# can also use chapter names here (not only numbers)
# expected values: disabledChapters: "Naming, Comments, General, Variables, Functions, Classes"
Expand Down Expand Up @@ -173,8 +173,8 @@
- name: FILE_WILDCARD_IMPORTS
enabled: true
configuration:
# Allowed wildcards for imports (e.g. "import org.cqfn.diktat.*, import org.jetbrains.kotlin.*")
allowedWildcards: "kotlinx.serialization.*,org.cqfn.diktat.ruleset.utils.*"
# Allowed wildcards for imports (e.g. "import com.saveourtool.diktat.*, import org.jetbrains.kotlin.*")
allowedWildcards: "kotlinx.serialization.*,com.saveourtool.diktat.ruleset.utils.*"
# Checks unused imports
- name: UNUSED_IMPORT
enabled: true
Expand Down
6 changes: 3 additions & 3 deletions diktat-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("org.cqfn.diktat.buildutils.kotlin-jvm-configuration")
id("org.cqfn.diktat.buildutils.code-quality-convention")
id("org.cqfn.diktat.buildutils.publishing-signing-default-configuration")
id("com.saveourtool.diktat.buildutils.kotlin-jvm-configuration")
id("com.saveourtool.diktat.buildutils.code-quality-convention")
id("com.saveourtool.diktat.buildutils.publishing-signing-default-configuration")
}

project.description = "This module builds diktat-api"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cqfn.diktat
package com.saveourtool.diktat

import org.cqfn.diktat.api.DiktatCallback
import com.saveourtool.diktat.api.DiktatCallback
import java.nio.file.Path

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cqfn.diktat
package com.saveourtool.diktat

import org.cqfn.diktat.api.DiktatRuleSet
import com.saveourtool.diktat.api.DiktatRuleSet

/**
* A factory to create [DiktatProcessor] using [DiktatRuleSet]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.cqfn.diktat
package com.saveourtool.diktat

import org.cqfn.diktat.api.DiktatBaseline
import org.cqfn.diktat.api.DiktatBaseline.Companion.skipKnownErrors
import org.cqfn.diktat.api.DiktatProcessorListener
import org.cqfn.diktat.api.DiktatProcessorListener.Companion.countErrorsAsProcessorListener
import org.cqfn.diktat.api.DiktatReporter
import com.saveourtool.diktat.api.DiktatBaseline
import com.saveourtool.diktat.api.DiktatBaseline.Companion.skipKnownErrors
import com.saveourtool.diktat.api.DiktatProcessorListener
import com.saveourtool.diktat.api.DiktatProcessorListener.Companion.countErrorsAsProcessorListener
import com.saveourtool.diktat.api.DiktatReporter
import java.nio.file.Path
import java.util.concurrent.atomic.AtomicInteger
import kotlin.io.path.readText
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cqfn.diktat
package com.saveourtool.diktat

import org.cqfn.diktat.api.DiktatProcessorListener
import com.saveourtool.diktat.api.DiktatProcessorListener
import java.io.OutputStream
import java.nio.file.Path
import kotlin.io.path.absolutePathString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cqfn.diktat
package com.saveourtool.diktat

import org.cqfn.diktat.api.DiktatBaseline
import org.cqfn.diktat.api.DiktatBaselineFactory
import org.cqfn.diktat.api.DiktatProcessorListener
import org.cqfn.diktat.api.DiktatProcessorListener.Companion.closeAfterAllAsProcessorListener
import org.cqfn.diktat.api.DiktatReporter
import org.cqfn.diktat.api.DiktatReporterFactory
import org.cqfn.diktat.api.DiktatRuleSetFactory
import com.saveourtool.diktat.api.DiktatBaseline
import com.saveourtool.diktat.api.DiktatBaselineFactory
import com.saveourtool.diktat.api.DiktatProcessorListener
import com.saveourtool.diktat.api.DiktatProcessorListener.Companion.closeAfterAllAsProcessorListener
import com.saveourtool.diktat.api.DiktatReporter
import com.saveourtool.diktat.api.DiktatReporterFactory
import com.saveourtool.diktat.api.DiktatRuleSetFactory
import java.io.OutputStream
import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import java.nio.file.Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

/**
* Callback for diktat process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

/**
* Error found by `diktat`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

/**
* The **file-specific** error emitter, initialized and used in [DiktatRule] implementations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import java.io.OutputStream
import java.nio.file.Path
import java.util.concurrent.atomic.AtomicInteger

/**
* A listener for [org.cqfn.diktat.DiktatProcessor]
* A listener for [com.saveourtool.diktat.DiktatProcessor]
*/
interface DiktatProcessorListener {
/**
* Called once, before [org.cqfn.diktat.DiktatProcessor] starts process a bunch of files.
* Called once, before [com.saveourtool.diktat.DiktatProcessor] starts process a bunch of files.
*
* @param files
*/
fun beforeAll(files: Collection<Path>): Unit = Unit

/**
* Called before each file when [org.cqfn.diktat.DiktatProcessor] starts to process it.
* Called before each file when [com.saveourtool.diktat.DiktatProcessor] starts to process it.
*
* @param file
*/
fun before(file: Path): Unit = Unit

/**
* Called on each error when [org.cqfn.diktat.DiktatProcessor] detects such one.
* Called on each error when [com.saveourtool.diktat.DiktatProcessor] detects such one.
*
* @param file
* @param error
Expand All @@ -36,14 +36,14 @@ interface DiktatProcessorListener {
): Unit = Unit

/**
* Called after each file when [org.cqfn.diktat.DiktatProcessor] finished to process it.
* Called after each file when [com.saveourtool.diktat.DiktatProcessor] finished to process it.
*
* @param file
*/
fun after(file: Path): Unit = Unit

/**
* Called once, after the processing of [org.cqfn.diktat.DiktatProcessor] finished.
* Called once, after the processing of [com.saveourtool.diktat.DiktatProcessor] finished.
*/
fun afterAll(): Unit = Unit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import java.io.OutputStream
import java.nio.file.Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import org.jetbrains.kotlin.com.intellij.lang.ASTNode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

/**
* A group of [DiktatRule]'s as a single set.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.cqfn.diktat.api
package com.saveourtool.diktat.api

import java.nio.file.Path
import kotlin.io.path.absolutePathString
Expand Down
Loading