Allow leading newlines for source map and copyright comments #2121

Merged
merged 2 commits into from Nov 26, 2016

Projects

None yet

3 participants

@jwilsson
Contributor

Which issue, if any, is this issue related to?

#2120

Is there anything in the PR that needs further explanation?

I opted for a regexp to check for any kind of whitespace so it will accept tabs as well. Let me know if you want tests for tabs too.

@jwilsson jwilsson Allow leading newlines for source map and copyright comments
fed6041
@jwilsson
Contributor

I've never worked with Jest before but when looking at the build failure, I'm guessing I need to update the snapshots for it?

@jeddy3
Member
jeddy3 commented Nov 26, 2016 edited

I'm guessing I need to update the snapshots for it?

The jest snapshots changes look good:

Object {
             "column": 3,
    -        "line": 1,
    -        "rule": "comment-whitespace-inside",
    -        "severity": "error",
    -        "text": "Expected whitespace after "/*" (comment-whitespace-inside)",
    -      },

i.e. we are loosing one comment-whitespace-inside warning at 1:3. This is correct as the top of the 001 stylesheet looks like so:

/*!
 * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com)
 * Copyright 2011-2016 The Bootstrap Authors
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */

Where the bootstrap copyright was erroneously triggering a warning (and the normalise one was not)

@jwilsson Yep, press u at the interactive menu (npm run jest -- --watch) to update the snapshot, and then commit&push the changes.

@jwilsson jwilsson Update Jest snapshots
0aad8a6
@jwilsson
Contributor

@jeddy3 Cool, thanks for the explanation!

Snapshots are updated.

@davidtheclark
Contributor

Thanks @jwilsson!

@davidtheclark davidtheclark merged commit c4285ac into stylelint:master Nov 26, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.04%) to 95.645%
Details
@davidtheclark davidtheclark added a commit that referenced this pull request Nov 26, 2016
@davidtheclark davidtheclark Update CHANGELOG.md 04b7269
@davidtheclark
Contributor

Added note to changelog:

  • Fixed: comment-whitespace-inside no longer complains about /*! comments with non-space whitespace (e.g. newlines) (#2121)
@jwilsson jwilsson deleted the unknown repository branch Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment