forked from saveourtool/diktat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support running diktat without configuration (saveourtool#1837)
- moved all from 'diktat-common' to 'diktat-rules' and `diktat-api` - support empty configuration in plugins and cli
- Loading branch information
Showing
40 changed files
with
335 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
diktat-api/src/main/kotlin/com/saveourtool/diktat/Constants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* This file contains common constants for Diktat | ||
*/ | ||
|
||
package com.saveourtool.diktat | ||
|
||
/** | ||
* Common application name, that is used in plugins and can be used to Suppress all diktat inspections on the | ||
* particular code block with @Suppress("diktat") | ||
*/ | ||
const val DIKTAT = "diktat" | ||
|
||
/** | ||
* Default file name for config file | ||
*/ | ||
const val DIKTAT_ANALYSIS_CONF = "diktat-analysis.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
diktat-api/src/main/kotlin/com/saveourtool/diktat/api/DiktatRuleNameAware.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.saveourtool.diktat.api | ||
|
||
/** | ||
* This interface represents *name* of individual inspection in rule set. | ||
*/ | ||
interface DiktatRuleNameAware { | ||
/** | ||
* @return name of this [DiktatRule] | ||
*/ | ||
fun ruleName(): String | ||
} |
20 changes: 20 additions & 0 deletions
20
diktat-api/src/main/kotlin/com/saveourtool/diktat/common/config/rules/LegacyAliases.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Contains typealias for legacy support | ||
*/ | ||
|
||
package com.saveourtool.diktat.common.config.rules | ||
|
||
import com.saveourtool.diktat.api.DiktatRuleConfig | ||
import com.saveourtool.diktat.api.DiktatRuleNameAware | ||
|
||
const val DIKTAT_CONF_PROPERTY = "diktat.config.path" | ||
|
||
/** | ||
* this constant will be used everywhere in the code to mark usage of Diktat ruleset | ||
* | ||
* Should be removed from Diktat's code and should be presented only in `diktat-ruleset` | ||
*/ | ||
const val DIKTAT_RULE_SET_ID = "diktat-ruleset" | ||
|
||
typealias RulesConfig = DiktatRuleConfig | ||
typealias Rule = DiktatRuleNameAware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
...ommon/src/main/kotlin/com/saveourtool/diktat/common/config/reader/AbstractConfigReader.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.