Skip to content

Disable no wildcard rule #435

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

Merged
merged 2 commits into from
May 22, 2019
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ It's also [easy to create your own](#creating-a-reporter).
## Standard rules

- 4 spaces for indentation
(unless a different `indent_size` value is set in .editorconfig (see [EditorConfig](#editorconfig) section for more));
- No semicolons (unless used to separate multiple statements on the same line);
- No wildcard / unused `import`s;
- No consecutive blank lines;
- No blank lines before `}`;
- No trailing whitespaces;
- No `Unit` returns (`fun fn {}` instead of `fun fn: Unit {}`);
- No empty (`{}`) class bodies;
- No spaces around range (`..`) operator;
- No newline before (binary) `+` & `-`, `*`, `/`, `%`, `&&`, `||`;
- When wrapping chained calls `.`, `?.` and `?:` should be placed on the next line;
- When a line is broken at an assignment (`=`) operator the break comes after the symbol;
- When class/function signature doesn't fit on a single line, each parameter must be on a separate line;
- Consistent string templates (`$v` instead of `${v}`, `${p.v}` instead of `${p.v.toString()}`);
- Consistent order of modifiers;
- Consistent spacing after keywords, commas; around colons, curly braces, parens, infix operators, comments, etc;
- Newline at the end of each file (not enabled by default, but recommended)
(unless a different `indent_size` value is set in .editorconfig (see [EditorConfig](#editorconfig) section for more))
- No semicolons (unless used to separate multiple statements on the same line)
- No unused `import`s
- No consecutive blank lines
- No blank lines before `}`
- No trailing whitespaces
- No `Unit` returns (`fun fn {}` instead of `fun fn: Unit {}`)
- No empty (`{}`) class bodies
- No spaces around range (`..`) operator
- No newline before (binary) `+` & `-`, `*`, `/`, `%`, `&&`, `||`
- When wrapping chained calls `.`, `?.` and `?:` should be placed on the next line
- When a line is broken at an assignment (`=`) operator the break comes after the symbol
- When class/function signature doesn't fit on a single line, each parameter must be on a separate line
- Consistent string templates (`$v` instead of `${v}`, `${p.v}` instead of `${p.v.toString()}`)
- Consistent order of modifiers
- Consistent spacing after keywords, commas; around colons, curly braces, parens, infix operators, comments, etc
- Newline at the end of each file (not enabled by default, but recommended)
(set `insert_final_newline=true` in .editorconfig to enable (see [EditorConfig](#editorconfig) section for more)).

## Experimental rules
Expand All @@ -56,6 +56,13 @@ by passing the `--experimental` flag to `ktlint`.
- Indentation formatting
- Import ordering

## Disabled rules
- No wildcard `import`s
- Annotation formatting
- No underscores in package names
- Braces required for if/else statements
- Multi-line lambdas must name `it` param

## EditorConfig

ktlint recognizes the following [.editorconfig](http://editorconfig.org/) properties (provided they are specified under `[*.{kt,kts}]`):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class StandardRuleSetProvider : RuleSetProvider {
NoTrailingSpacesRule(),
NoUnitReturnRule(),
NoUnusedImportsRule(),
NoWildcardImportsRule(),
// Disabling because it is now allowed by the Jetbrains styleguide, although it is still disallowed by
// the Android styleguide.
// Re-enable when there is a way to globally disable rules
// See discussion here: https://github.com/pinterest/ktlint/issues/48
// NoWildcardImportsRule(),
ParameterListWrappingRule(),
SpacingAroundColonRule(),
SpacingAroundCommaRule(),
Expand Down