Comments (1)
From the RuleSetProvider
documentation (0.47.x):
This method is going to be called once for each file (which means if any of the rules have state or
are not thread-safe - a newRuleSet
must be created).This method is marked for removal in KtLint 0.48 for reason below:
For each invocation of
KtLint.lint
andKtLint.format
theRuleSet
is retrieved. This results in new
instances of eachRule
for each file being processed. As of that aRule
does not need to be thread-safe.However,
KtLint.format
requires theRule
to be executed twice on o a file in case at least one violation
has been autocorrected. As the sameRule
instance is reused for the second execution of theRule
, the state
of theRule
is shared. As of thisRule
have to clear their internal state.
So now rules are expected to have a state, and a new Rule
instance is created per a file checked.
from diktat.
Related Issues (20)
- JPA: prohibit using @Enity annotation on data classes HOT 1
- Support ignoring `EMPTY_BLOCK_STRUCTURE_ERROR` with config HOT 2
- Add main class for diktat.jar HOT 2
- Regression witn 1.2.4: NoSuchMethodError in JUnit test HOT 3
- [EPIC] Wrap Ktlint HOT 4
- Create a wrapper to run diktat in maven plugin
- Downgrade ktlint in master
- Add more integration tests to check Diktat compatibility with KtLint HOT 2
- CONSTANT_UPPERCASE doesn't handle number in middle name
- CCE: class `org.slf4j.helpers.NOPLogger` cannot be cast to class `ch.qos.logback.classic.Logger` when running Diktat as a Gradle plug-in HOT 6
- Need to add an exception dictionary for `CLASS_NAME_INCORRECT` HOT 3
- Extension function with class
- `WRONG_INDENTATION` rule incorrectly formatting custom getters when `extendedIndentForExpressionBodies` is `true`
- False positive with single expression functions that use multiple `return` keywords HOT 2
- `WRONG_OVERLOADING_FUNCTION_ARGUMENTS` false positive with mixed inline/non-inline overloads HOT 2
- False positive `WRONG_OVERLOADING_FUNCTION_ARGUMENTS`
- WRONG_MULTIPLE_MODIFIERS_ORDER triggers on SAM interface HOT 2
- Bug in fix mode of `WRONG_ORDER_IN_CLASS_LIKE_STRUCTURES` rule HOT 3
- `BLANK_LINE_BETWEEN_PROPERTIES`, `WRONG_ORDER_IN_CLASS_LIKE_STRUCTURES` HOT 2
- File annotation gives `IllegalArgumentException: can only move child of this node` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diktat.