Comments (4)
I guess we need a null check here https://github.com/ec4j/editorconfig-maven-plugin/blob/master/editorconfig-maven-plugin/src/main/java/org/ec4j/maven/AbstractEditorconfigMojo.java#L313 and a test case. A PR is welcome :)
from editorconfig-maven-plugin.
I was thinking... What do you think of the "for" looks like this?
for (String exclude : excludes) {
if (exclude == null || exclude.trim().length() == 0) {
continue;
}
excls.add(exclude);
}
Maybe creating a StringUtils to check if a String is null or empty is a good one.
from editorconfig-maven-plugin.
Well, if you ask me, add() under if would be one line less.
for (String exclude : excludes) {
if (exclude != null && exclude.trim().length() > 0) {
excls.add(exclude);
}
}
BTW, is the trim() necessary? AFAIK, Maven trims the values coming from pom.xml itself but I have no idea about list items passed on the command line.
Maybe creating a StringUtils to check if a String is null or empty is a good one.
I am not in favor of that. I find the expression better readable.
from editorconfig-maven-plugin.
Fixed in the just released version 0.0.11. Thanks again for the report.
from editorconfig-maven-plugin.
Related Issues (20)
- This project is not using .editorconfig
- No support for java files HOT 1
- insert_final_newline does not work
- Link to central.maven.org unreachable HOT 1
- 404 for maven goals on http://ec4j.github.io/editorconfig-maven-plugin/ HOT 3
- A pair has a key but not a value HOT 3
- Plugin not apply indent_style, indent_size to *.java files HOT 1
- Mark mojos as threadSafe HOT 2
- Links in the README broken after moving the linters to a separate git repo HOT 2
- Plugin doesn't respect .editorconfig sections HOT 2
- Empty files should pass with insert_final_newline = true HOT 3
- Ignore files in .gitignore HOT 6
- YAML Linter HOT 1
- Default excludes are lost if supplied excludes are null
- Wrong tab indentation with XML linter HOT 6
- Sometimes check goal fails during a Jenkins build HOT 1
- standalone XML files
- [Query] Editor Config Maven Plugin for Java HOT 1
- Disable the check for single mvn calls HOT 1
- DirectoryScanner missing on Maven 3.9.0 HOT 3
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 editorconfig-maven-plugin.