Comments (2)
This is an interesting one. It took me a while to work this out, because I couldn't get my tests to fail. I couldn't reproduce it. After digging, I found something: you seem to be adding the blank line yourself:
<?xml version="1.0" encoding="UTF-8"?>
<scalastyle>
<name>Some test Scalastyle config</name>
<check class="org.scalastyle.file.HeaderMatchesChecker" enabled="true"
level="error">
<parameters>
<parameter name="header"><![CDATA[/*
This is some standard boilerplate that our boring lawyers force us to add to
every file whether we like it or not. Unfortunately, Scalastyle doesn't seem to
treat the header "as is" and appends a blank line to it, so that it fails the
header check. Any ideas?]]> <!-- this carriage return is also taken as part of the header -->
</parameter> <!-- same for the whitespace at the beginning of the line -->
</parameters>
</check>
</scalastyle>
Scalastyle takes all of the text in the parameter element. You've got a CDATA section, but it also includes the carriage return at the end of the line. The fix should be simple: remove the blank line:
<?xml version="1.0" encoding="UTF-8"?>
<scalastyle>
<name>Some test Scalastyle config</name>
<check class="org.scalastyle.file.HeaderMatchesChecker" enabled="true"
level="error">
<parameters>
<parameter name="header"><![CDATA[/*
This is some standard boilerplate that our boring lawyers force us to add to
every file whether we like it or not. Unfortunately, Scalastyle doesn't seem to
treat the header "as is" and appends a blank line to it, so that it fails the
header check. Any ideas?]]></parameter>
</parameters>
</check>
</scalastyle>
This should work. If it does, please close this issue.
from scalastyle.
Doh! You're quite right! It's obvious when you look at it that way.
Thanks for taking the time to investigate this, Matthew!
from scalastyle.
Related Issues (20)
- ImportControl check HOT 2
- How does one force format files using sbt plugin?
- The string literal ]" appears multiple times in this file warning HOT 1
- The double blank lines doesn't work.
- "lexicographic" parameter sometimes ignored in ImportsChecker
- IndentationChecker refuses comments at the start of line
- Wrong error message when for ,) inside anonymous function or in flatMap/map/flapTap etc
- IndentationChecker on multiple commented line
- TODO/FIXME not work HOT 1
- Generate scalastyle.html report from scalastyle.xml HOT 1
- Is this project EOL? HOT 1
- Sort imports issue by scalastyle consistent in IntelliJ IDEA
- Show up "Expected token ARROW but got Token(RBRACKET,],3116,])" when using EitherT.leftT[IO,()]
- Scalastyle Documentation Coverage Analysis
- Some issues in the default config provided on the website
- Execution error when you have xml parts in s" block
- Expected identifier error `STRING_LITERAL` when defining Refined Regex
- org.scalastyle.scalariform.ScalaDocChecker checker rule
- String index out of range: -1 version 0.8 or 1.0 environment docker linux
- Unhelpful error on trailing comma on last element in `Seq` literal HOT 1
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 scalastyle.