0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Commit Graph

13 Commits

Author SHA1 Message Date
David Allison
2478135b20 chore(lint): cleanup CI output on failure
'WrongThread' output 100+ lines of 'Information' which obscured the
error

Remove these in CI

Fixes 14853
2023-11-30 20:40:45 -05:00
Mike Hardy
a06e727f60
Dependency Updates 20220219 (#13305)
* Bump org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0 (#13265)

* Bump org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0

Bumps org.jlleitschuh.gradle:ktlint-gradle from 11.1.0 to 11.2.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle:ktlint-gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): move ktlint rules to .editorconfig

With new syntax

----

An individual property can be enabled or disabled with a rule property.
The name of the rule property consists of the ktlint_ prefix followed
by the rule set id followed by a _ and the rule id.

> https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this

----

disabled_rules is deprecated:

https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this

ktlint-gradle v11.2.0 resolves a few issues around this

> Fixed disabled_rules set only in editorconfig in ktlint 0.46+
> Fixed disabled_rules warning when using new editorconfig syntax in ktlint 0.48+

https://github.com/JLLeitschuh/ktlint-gradle/releases/tag/v11.2.0

* lint: fix new ktlint errors

Caused when we remove the version specifier in ktlint-gradle

* Argument should be on a separate line (unless all arguments can fit a single line)
* File annotations should be separated from file contents with a blank line
* Declarations and declarations with comments should have an empty space between.
* Multiple annotations should not be placed on the same line as the annotated construct

Removed unused `KotlinCleanup` class rather than fixing lint errors

* build(deps): depend on ktlint-gradle's ktlint

Some lint indentation was reduced due to this.
Fixed it manually as I didn't like the change

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>

* autoformat squash

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2023-02-19 12:15:26 -05:00
David Allison
4823e15e44 refactor(lint): remove textOutput
Not necessary according to the docs
2023-02-16 10:37:06 -05:00
David Allison
a5251c15ab AGP: Migrate DSL properties from lintOptions to lint
AGP 7.4.1

Description:

Configuration related to lint is now performed using the lint block.

----
Change summary: Automated change + manual fixups

Automated change blanked and inlined lint.gradle into `build.gradle`
Manually fixed this to change `lint.gradle`

Afterwards, we have a NullReferenceException caused by `textOutput "stdout"`

From the docs:

> To output the lint report to stdout set textReport=true, and leave textOutput unset.

https://developer.android.com/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Lint#textOutput()
2023-02-16 10:37:06 -05:00
Piyush Goel
f61fa492bc lint: enable linting unit tests 2021-10-20 22:58:42 -05:00
Mike Hardy
c458d18843 style(lint): report lint errors via text on stdout
This lets you see build errors from lint right where you want them

Fixes #9553
2021-09-24 12:46:51 -05:00
David Allison
fcf111c329 lint: remove "debug" config
After moving to AGP 7, we can no longer apply lintConfig on
`task.doFirst`

Since we're not using the baseline/debug config, we might as well
simplify this file and remove the implementation.

Baseline usage was never properly implemented, and was on Travis CI
which we are no longer using.

Related: 9338
2021-07-31 14:58:53 -05:00
lukstbit
018c1db71f Update severity for time related lint violations 2020-08-30 18:24:56 -05:00
David Allison
f04aae0a4f Fix invalid cast: onSystemUiVisibilityChange
LinearLayout had changed to a FrameLayout

Also add a lint check to ensure this doesn't happen in the future

Fixes 6977
2020-08-28 15:27:18 -05:00
David Allison
c6fd9a0664 Ignore inspection: ObsoleteLintCustomCheck
> If I understand it correctly based on the text provided in the
 > output, is not actionable by us - it is an upstream issue.

 > I've taken it upon myself to PR upstream lots of times for things
 > that affect AnkiDroid (in requery, doing google-analytics-java,
 > google libraries etc) but this seems like it will be recurring
 > and upstream, and for me that's just upstream responsibility,
 > no action for me. So not worth seeing

Documented in #6211
2020-05-19 09:32:42 -05:00
David Allison
45712f6b43 Remove 'SyntheticAccessor' from lint check
Based on a discussion in #6205, we currently have more important issues
picked up by lint than performance penalties.

This removes 875 lint warnings. We should eventually re-enable this once
we have lint errors close to, or nearer to zero.

I changed my personal config to mark these as 'Weak Warning'
2020-05-19 09:32:42 -05:00
Mike Hardy
cb7737770f Vary lint config debug vs release, CI allows debug lint
We want to expose when the lint results change vs current baseline, but
we can't hard fail on them because they are subject to false-positive just because
line numbers changed

For the smaller set of things that we classify as release blockers we do want
CI to check and hard fail for

Also updated the current debug baseline
2020-05-16 16:38:34 -05:00
Mike Hardy
4265acb367 Turn on most lint checks but filter by current baseline
If this is correct then future lint errors should break the build,
while existing ones will pass.

This should put a cap on the accretion of new lint while we start
to whittle down the existing pile
2020-05-15 12:00:07 -05:00