nebula-plugins / gradle-lint-plugin

A pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts.
Apache License 2.0
761 stars 88 forks source link

A specific dependency notation causes incorrect behavior #373

Open sergeykad opened 2 years ago

sergeykad commented 2 years ago

Expected behavior

The plugin works correctly regardless of the used dependency notation or at least returns a clear error message.

Actual behavior

Using the following format causes incorrect behavior. For example auto-fix will remove all the listed dependencies if at least one of them is redundand.

implementation 'org.apache.logging.log4j:log4j-core:2.17.2',
         'commons-codec:commons-codec:1.11'

If the dependency specified as below everithing works correctly.

implementation 'org.apache.logging.log4j:log4j-core:2.17.2'
implementation 'commons-codec:commons-codec:1.11'

Environment

Using "nebula.lint" version "17.6.1" with Gradle 7.4, but it is reproducible on older versions as well.