GithubHelp home page GithubHelp logo

Comments (2)

matthewfarwell avatar matthewfarwell commented on May 21, 2024

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.

Facsimiler avatar Facsimiler commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.