Skip to content

Commit

Permalink
Rename s/(cqfn|analysis-dev)/saveourtool/g in URLs
Browse files Browse the repository at this point in the history
### What's done:

 * URLs (incl. those from badges) have been corrected to accommodate for the organization name change.
  • Loading branch information
unix-junkie committed May 27, 2022
1 parent 0265e99 commit 49bbef2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/diktat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
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
wget -O $DIKTAT_CONFIG https://raw.githubusercontent.com/saveourtool/diKTat/$LATEST_TAG/$DIKTAT_CONFIG
- name: Run diktat via maven plugin
run: mvn -B diktat:check@diktat -DskipPluginMarker
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<img src="/logo.svg" width="64px"/>

![Build and test](https://github.com/cqfn/diKTat/workflows/Build%20and%20test/badge.svg)
![deteKT static analysis](https://github.com/cqfn/diKTat/workflows/Run%20deteKT/badge.svg)
![diKTat code style](https://github.com/cqfn/diKTat/workflows/Run%20diKTat%20from%20release%20version/badge.svg?branch=master)
![Build and test](https://github.com/saveourtool/diKTat/workflows/Build%20and%20test/badge.svg)
![deteKT static analysis](https://github.com/saveourtool/diKTat/workflows/Run%20deteKT/badge.svg)
![diKTat code style](https://github.com/saveourtool/diKTat/workflows/Run%20diKTat%20from%20release%20version/badge.svg?branch=master)
[![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/cqfn/diKTat)](https://github.com/cqfn/diKTat/releases)
[![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)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcqfn%2FdiKTat.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcqfn%2FdiKTat?ref=badge_shield)
[![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/diktat_help)

[![Hits-of-Code](https://hitsofcode.com/github/cqfn/diktat)](https://hitsofcode.com/view/github/cqfn/diktat)
![Lines of code](https://img.shields.io/tokei/lines/github/cqfn/diktat)
![GitHub repo size](https://img.shields.io/github/repo-size/cqfn/diktat)
[![Hits-of-Code](https://hitsofcode.com/github/saveourtool/diktat)](https://hitsofcode.com/view/github/saveourtool/diktat)
![Lines of code](https://img.shields.io/tokei/lines/github/saveourtool/diktat)
![GitHub repo size](https://img.shields.io/github/repo-size/saveourtool/diktat)
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)


Expand Down Expand Up @@ -56,11 +56,11 @@ Main features of diktat are the following:
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.43.2/ktlint && chmod a+x ktlint
```

2. Load diKTat manually: [here](https://github.com/cqfn/diKTat/releases/download/v1.1.0/diktat-1.1.0.jar)
2. Load diKTat manually: [here](https://github.com/saveourtool/diKTat/releases/download/v1.1.0/diktat-1.1.0.jar)

**OR** use curl:
```bash
$ curl -sSLO https://github.com/cqfn/diKTat/releases/download/v1.1.0/diktat-1.1.0.jar
$ curl -sSLO https://github.com/saveourtool/diKTat/releases/download/v1.1.0/diktat-1.1.0.jar
```
</details>

Expand All @@ -87,7 +87,7 @@ export MAVEN_OPTS="--add-opens java.base/java.util=ALL-UNNAMED"
```

This plugin is available since version 0.1.3. You can see how it is configured in our project for self-checks: [pom.xml](pom.xml).
If you use it and encounter any problems, feel free to open issues on [github](https://github.com/cqfn/diktat/issues).
If you use it and encounter any problems, feel free to open issues on [github](https://github.com/saveourtool/diktat/issues).

<details>
<summary>Add this plugin to your pom.xml:</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract class DiktatRule(
logic(node)
} catch (internalError: Throwable) {
log.error(
"""Internal error has occurred in rule [$id]. Please make an issue on this bug at https://github.com/cqfn/diKTat/.
"""Internal error has occurred in rule [$id]. Please make an issue on this bug at https://github.com/saveourtool/diKTat/.
As a workaround you can disable these inspections in yml config: <$inspections>.
Root cause of the problem is in [${node.getFilePath()}] file.
""".trimIndent(), internalError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RulesConfigValidationTest {
}

@Test
@Disabled("https://github.com/cqfn/diKTat/issues/395")
@Disabled("https://github.com/saveourtool/diKTat/issues/395")
fun `should throw error on invalid configuration section`() {
file.writeText(
"""
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</licenses>

<scm>
<connection>scm:git:git://github.com/cqfn/diktat.git</connection>
<developerConnection>scm:git:ssh://github.com:cqfn/diktat.git</developerConnection>
<url>http://github.com/cqfn/diktat/tree/master</url>
<connection>scm:git:git://github.com/saveourtool/diktat.git</connection>
<developerConnection>scm:git:ssh://github.com:saveourtool/diktat.git</developerConnection>
<url>http://github.com/saveourtool/diktat/tree/master</url>
</scm>

<developers>
Expand Down
2 changes: 1 addition & 1 deletion wp/sections/diKTat.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\subsection{What is diKTat?}
DiKTat \footnote{\url{https://github.com/cqfn/diKTat}} - is a formal strict code-style for Kotlin language and a linter with a set of rules that implement this code-style. Basically, it is a collection of Kotlin code style rules implemented as AST visitors on top of KTlint framework \footnote{\url{https://github.com/pinterest/ktlint}}. Diktat detects and automatically fixes code style errors and code smells based on the configuration of rules. DiKTat is a highly configurable framework, that can be extended further by adding custom rules. It can be run as command line application or with maven or gradle plugins. In this paper, we will explain how diKTat works, describe its advantages and disadvantages and compare it with other static analyzers for Kotlin. The main idea is to use diktat in your CI/CD pipeline.
DiKTat \footnote{\url{https://github.com/saveourtool/diKTat}} - is a formal strict code-style for Kotlin language and a linter with a set of rules that implement this code-style. Basically, it is a collection of Kotlin code style rules implemented as AST visitors on top of KTlint framework \footnote{\url{https://github.com/pinterest/ktlint}}. Diktat detects and automatically fixes code style errors and code smells based on the configuration of rules. DiKTat is a highly configurable framework, that can be extended further by adding custom rules. It can be run as command line application or with maven or gradle plugins. In this paper, we will explain how diKTat works, describe its advantages and disadvantages and compare it with other static analyzers for Kotlin. The main idea is to use diktat in your CI/CD pipeline.

\subsection{Why diKTat?}
DiKTat permits formal flexible description or Rules and Inspections expressed by means of yml file. We looked at similar existing projects and realized that their functionality does not give us a chance to implement our own configurable code style. Most of rules which we wanted to implement were missing in other analyzers. Mostly all of those analyzers had hardcoded logic and prohibited configuration. That’s why we decided that we need to create convenient, user friendly and easily configured tool for developers.
Expand Down
2 changes: 1 addition & 1 deletion wp/sections/work.tex
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ \subsection{DiKTat}

Another feature of ktlint is that at it's startup you can provide a JAR file with additional ruleset(s), that will be discovered by the \texttt{ServiceLoader} and then all AST nodes will be passed to these rules. DiKTat uses this approach.

The only modification Diktat makes to the framework is that it adds a mechanism to disable Inspection from the code using annotations or configuration file. The set of all rules is described in the \textsl{DiktatRuleSetProvider}\footnote{\url{https://github.com/cqfn/diKTat/blob/v0.1.3/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt}} class. This class overrides the \textsl{get()} method of the \textsl{RuleSetProvider}\footnote{\url{https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/RuleSetProvider.kt}} interface, which returns a set of rules to be "traversed". But before returning this set Diktat is reading the configuration file where the user has independently configured all the Inspections. If there is no configuration file, then a warning will be displayed and Inspections will use the default configuration file.
The only modification Diktat makes to the framework is that it adds a mechanism to disable Inspection from the code using annotations or configuration file. The set of all rules is described in the \textsl{DiktatRuleSetProvider}\footnote{\url{https://github.com/saveourtool/diKTat/blob/v0.1.3/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt}} class. This class overrides the \textsl{get()} method of the \textsl{RuleSetProvider}\footnote{\url{https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/RuleSetProvider.kt}} interface, which returns a set of rules to be "traversed". But before returning this set Diktat is reading the configuration file where the user has independently configured all the Inspections. If there is no configuration file, then a warning will be displayed and Inspections will use the default configuration file.
Each rule must implement the \textsl{visit} method of the abstract Rule class, which describes the logic of the rule. By the way it is a special case of a famous pattern Visitor \cite{ref:gang}. Implementation example of the simple Rule that contains one Inspections can be found below.

\begin{lstlisting}[caption={Example of the Rule.}, label={lst:example1}, language=Kotlin]
Expand Down

0 comments on commit 49bbef2

Please sign in to comment.