Skip to content

Commit

Permalink
Merge pull request #741 from sasstools/release/1.8.0
Browse files Browse the repository at this point in the history
Prepare 1.8.0 release
  • Loading branch information
DanPurdy committed Jun 17, 2016
2 parents e364a25 + 04af08c commit 9ee2b85
Show file tree
Hide file tree
Showing 151 changed files with 6,784 additions and 1,645 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,21 @@
<!--
Please include as much information as possible about your issue/request.
Make sure you've read through our [contribution guidelines](https://github.com/sasstools/sass-lint/blob/develop/CONTRIBUTING.md#submitting-issues) first.
If you would like to propose a feature please ignore some of the headings below but include as much information as you can and if possible any relevant test case code samples.
-->


What version of Sass Lint are you using?

Please include any relevant parts of your configuration

What did you do? Please include the actual source code causing the issue.

What did you expect to happen?

What actually happened? Please include any error messages given to you by Sass Lint.

If you're using a IDE plugin have you tried the CLI too?
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,24 @@
<!--
## New Pull Request Information
Please make sure you have read through our [contribution guidelines](https://github.com/sasstools/sass-lint/blob/develop/CONTRIBUTING.md#pull-requests) before submitting a pull request.
Most importantly your pull request should provide information on what the changes do and they should reference an already created issue. e.g. 'Fixes #80' for bugs and 'Closes #90' for other issues.
Please use the headings below as guidance, you don't need to answer them point for point but the contents give you an idea of what we'd like to know about your PR.
You must also include your agreement to the developer certificate of origin below.
-->

**What do the changes you have made achieve?**

**Are there any new warning messages?**

**Have you written tests?**

**Have you included relevant documentation**

**Which issues does this resolve?**

`<DCO 1.1 Signed-off-by: YOUR_FULL_NAME YOUR_EMAIL>`
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '0.10'
- '0.12'
- '4'
- '5'
Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,57 @@
# Sass Lint Changelog

## v1.8.0

**June 17, 2016**

We're gonna need a bigger boat

**Indentation**

A lot of work on the indentation rule is present in 1.8 including the following:

* Tabs are now supported and can be used as a valid option in your config [#592](https://github.com/sasstools/sass-lint/issues/592)
* LF and CRLF are now supported for both spaces and tabs.
* `.sass` support is now included (Could be a little buggy due to some discrepancies in the AST) [#611](https://github.com/sasstools/sass-lint/issues/611)
* Mixed spaces and tabs warnings are now correctly informing you if you've specified that you'll use spaces and it detects tabs. [#382](https://github.com/sasstools/sass-lint/issues/382)
* Indenting of multiline properties in media queries etc is now supported [#426](https://github.com/sasstools/sass-lint/issues/426)

**Fixes**
* Fixed an issue with interpolated properties in the `shorthand-values` rule [#669](https://github.com/sasstools/sass-lint/issues/669)
* Corrected the name of the `pseudo-element` rule [#682](https://github.com/sasstools/sass-lint/pull/682)
* Corrected the name of the `no-empty-rulesets` rule [#684](https://github.com/sasstools/sass-lint/issues/684)
* Corrected the name of the `no-trailing-zero` rule [#685](https://github.com/sasstools/sass-lint/issues/685)
* Fixed an issue where partially matching rules affected each others severity levels [#687](https://github.com/sasstools/sass-lint/issues/687)
* Fixed an issue with nested properties in the `no-misspelled-properties` [#352](https://github.com/sasstools/sass-lint/issues/352)
* Fixed an issue with interpolated properties in the `no-misspelled-properties` [#679](https://github.com/sasstools/sass-lint/issues/679)
* Fixed an issue with interpolated selectors in the `no-mergeable-selectors` [#703](https://github.com/sasstools/sass-lint/issues/703)
* Added the absolute path module to fix an issue with Node 0.10 [#706](https://github.com/sasstools/sass-lint/pull/706)
* Added a new method and updated gulp-sass-lint to fix an config files and ignored files not working correctly [#452](https://github.com/sasstools/sass-lint/issues/452)
* Fixed an issue with the `!important` flag raising a lint warning within the `variable-for-property` rule [#714](https://github.com/sasstools/sass-lint/issues/714)
* Fixed an issue where sass-lint would try to lint a directory with a .scss or .sass extension, now sass-lint will only attempt to lint files :tada: [#719](https://github.com/sasstools/sass-lint/pull/719) & [#555](https://github.com/sasstools/sass-lint/issues/555)
* Fixed an issue where Sass color functions would raise lint warnings in the `no-color-keywords` rule [#717](https://github.com/sasstools/sass-lint/issues/717)
* Fixed an unhandled error with the `pseudo-element` rule [#671](https://github.com/sasstools/sass-lint/pull/671)

**Changes**
* Added flexbox and outline properties to the recess order preset [#666](https://github.com/sasstools/sass-lint/issues/666)
* Added missing pseudo classes to our pseudo class master list [#675](https://github.com/sasstools/sass-lint/issues/675)
* Added pascal case format to all name format rules [#678](https://github.com/sasstools/sass-lint/issues/678)
* Included files in your config file can now be an array similar to the ignored files option [#668](https://github.com/sasstools/sass-lint/issues/668)
* Added PR and issue templates [#692](https://github.com/sasstools/sass-lint/pulls/692)
* Now testing on Node v6 [#699](https://github.com/sasstools/sass-lint/issues/699)
* Added the `ignore-non-standard` option to the `no-vendor-prefixes` rule. This allows you to blanket ignore the vendor prefixes on any non standard properties [#702](https://github.com/sasstools/sass-lint/issues/702)
* The `url-quotes` rule now highlights the beginning of the detect rather than the end [#712](https://github.com/sasstools/sass-lint/issues/712)
* All helper tests have been split and rearranged for ease of use when developing [#322](https://github.com/sasstools/sass-lint/pull/322)
* Moved away from our Gonzales-pe-sl fork back to gonzales-pe as we've made changes to the main AST now [#722](https://github.com/sasstools/sass-lint/pull/722)

**New Rules**
* Added `pseudo-element` rule to enforce the use of single colons in pseudo classes and double colons in pseudo elements. [#662](https://github.com/sasstools/sass-lint/issues/662)
* Added `no-universal-selectors` rule to warn against the use of universal selectors (*) [#694](https://github.com/sasstools/sass-lint/issues/694)
* Added `no-attribute-selectors` rule to warn against the use of attribute selectors [#694](https://github.com/sasstools/sass-lint/issues/694)
* Added `no-combinators` rule to warn against the use of combinators [#694](https://github.com/sasstools/sass-lint/issues/694)
* Added `attribute-quotes` rule to enforce the use of the use of quotes in attribute values [#707](https://github.com/sasstools/sass-lint/issues/707)
* Added `no-disallowed-properties` rule to warn against the use of certain properties. [#546](https://github.com/sasstools/sass-lint/issues/546)

## v1.7.0

**April 27, 2016**
Expand Down
52 changes: 49 additions & 3 deletions README.md
Expand Up @@ -7,6 +7,12 @@ A Node-only Sass linter for both `sass` and `scss` syntax!
## Install
You can get `sass-lint` from [NPM](https://www.npmjs.com/package/sass-lint):

Install globally
```
npm install -g sass-lint
```

To save to a project as a dev dependency
```
npm install sass-lint --save-dev
```
Expand Down Expand Up @@ -45,13 +51,26 @@ The following are options that you can use to config the Sass Linter.

#### Files

The `files` option can either be set to a [glob](https://github.com/isaacs/node-glob) or it can be set to an object, where the key `include` is set to the glob you want to include, and `ignore` set to either a glob string or an array of glob strings that you would like to ignore.
The `files` option contains two properties, `include` and `ignore`. Both can be set to either a [glob](https://github.com/isaacs/node-glob) or an array of glob strings/file paths depending on your projects' needs and setup.

For example below we are providing a singular glob string to our include property and an array of patterns to our ignore property:
```yml
files:
include: 'sass/**/*.s+(a|c)ss'
ignore:
- 'sass/vendor/**/*.*'
- 'sass/vendor/**/*.scss'
- 'sass/tests/**/*.scss'
```

As mentioned you can also provide an array to the include property like so
```yml
files:
include:
- 'sass/blocks/*.s+(a|c)ss'
- 'sass/elements/*.s+(a|c)ss'
ignore:
- 'sass/vendor/**/*.scss'
- 'sass/tests/**/*.scss'
```

#### Rules
Expand Down Expand Up @@ -102,6 +121,33 @@ or with long form flags
sass-lint --config app/config/.sass-lint.yml '**/*.scss' --verbose --no-exit
```

#### Including multiple source destinations
By default when specifying a directory/file to lint from the CLI you would do something similar to the following

```
sass-lint 'myapp/**/*.scss' -v -q
```

or with long form flags

```
sass-lint 'myapp/**/*.scss' --verbose --no-exit
```
> Notice that you need to wrap glob patterns in quotation marks
If you want to specify multiple input sources then you need to include a single comma and a space `, ` to separate each pattern as shown in the following
```
sass-lint 'myapp/dir1/**.*.scss, myapp/dir2/**/*.scss' -v -q
```

or with long form flags

```
sass-lint 'myapp/dir1/**.*.scss, myapp/dir2/**/*.scss' --verbose --no-exit
```

If you don't include the extra space after the comma then the multiple patterns will not be interpreted correctly and you could see `sass-lint` fail.

#### Ignore files/patterns
To add a list of files to ignore `tests/**/*.scss, dist/other.scss` into the mix you could do the following:
```
Expand All @@ -113,7 +159,7 @@ sass-lint --config app/config/.sass-lint.yml '**/*.scss' --verbose --no-exit --i
```


> Notice that glob patterns need to be wrapped in quotation or single quote marks in order to be passed to sass-lint correctly and if you want to ignore multiple paths you also need to wrap it in quotation marks and seperate each pattern/file with a comma and a space `, `.
> Notice that glob patterns need to be wrapped in quotation or single quote marks in order to be passed to sass-lint correctly and if you want to ignore multiple paths you also need to wrap it in quotation marks and separate each pattern/file with a comma and a space `, `.
This will be revisited and updated in `sass-lint` v2.0.0.

Expand Down
11 changes: 9 additions & 2 deletions appveyor.yml
Expand Up @@ -5,11 +5,18 @@ init:
# Test against this version of Node.js
environment:
matrix:
- nodejs_version: '0.10'
- nodejs_version: '0.12'
# io.js
- nodejs_version: '1'
- nodejs_version: '4'
# Latest version of Node
- nodejs_version: '5'
- nodejs_version: '1'
# Latest stable version of Node
- nodejs_version: 'stable'
matrix:
# Help instructions and version number don't show in appveyor
allow_failures:
- nodejs_version: '0.10'

# Install scripts. (runs after repo cloning)
install:
Expand Down
1 change: 1 addition & 0 deletions data/properties.yml
Expand Up @@ -270,6 +270,7 @@ justify-items
justify-self
kerning
@keyframes
keyframes
left
letter-spacing
lighting-color
Expand Down
36 changes: 36 additions & 0 deletions data/pseudoClasses.yml
@@ -0,0 +1,36 @@
active
checked
default
disabled
empty
enabled
first
first-child
first-of-type
focus
hover
indeterminate
in-range
invalid
lang
last-child
last-of-type
left
link
not
nth-child
nth-last-child
nth-last-of-type
nth-of-type
only-child
only-of-type
optional
out-of-range
read-only
read-write
required
right
root
target
valid
visited
6 changes: 6 additions & 0 deletions data/pseudoElements.yml
@@ -0,0 +1,6 @@
after
before
first-letter
first-line
selection
backdrop
4 changes: 3 additions & 1 deletion docs/cli/readme.md
Expand Up @@ -2,7 +2,7 @@

Sass Lint can be run via its Command Line Interface (CLI). To do so, run `sass-lint` from the command line.

By default, the command will run against the glob defined by a user's `file.include` option in their config, or a glob (or single file) can be passed as the last argument to the CLI to be explicitly run against.
By default, the command will run against the glob / array of globs defined by a user's `file.include` option in their config, or a glob / array of globs (or single files) can be passed as the last argument to the CLI to be explicitly run against.

> Please note that when using glob patterns such as `folder/**/*.scss` as a command line argument (files to be linted or ignored) you will need to wrap the pattern in quotes or escape the `*` characters to prevent bash/zsh from automatically expanding the glob pattern.
Expand All @@ -22,3 +22,5 @@ Command Line Flag | Description
`-s`,`--syntax` | Syntax to evaluate the given file(s) with, either sass or scss. Use with care: overrides filename extension-based syntax detection.
`-v`,`--verbose` | Verbose output (fully formatted output)
`-V`,`--version` | Outputs the version number of Sass Lint

To see more on how to use the CLI you can view the examples included within sass-lint's [readme](https://github.com/sasstools/sass-lint/blob/develop/README.md#cli)
70 changes: 68 additions & 2 deletions docs/options/config-file.md
@@ -1,5 +1,71 @@
# Config File

Option `config-file` will tell Sass Lint the path to a custom config file. `config-file` should be set to a path plus file name relative to where Sass Lint is being run from. If not included, Sass Lint will attempt to find the closest config file, or fall back to the default one.
### Configuration Options
When passing options directly to `Sass-lint` option `config-file` will tell Sass Lint the path to a custom config file. `config-file` should be set to a path plus file name relative to where Sass Lint is being run from OR an absolute path. If not included, Sass Lint will attempt to find the closest config file, or fall back to the default one.

Config File will only be respected if passed in as an option directly, not if it is already in a config file.
### Config File Options

You may specify a config file in your current config file as follows:

```yaml
options:
config-file: my-folder/my-other-config.yml
rules:
no-ids: 2
```

The config file loaded from the `config-file` option will be treated as a base config file and as such will be extended with the rules and options in your main config. The path of this must be either an absolute path or a path relative to your main config file.

**Absolute path**

`/root/my/projects/config/extend/.sass-lint.yml`

**Relative path**

`extra-config/.sass-lint.yml`

## Example

**Project Structure**
```
my-project/
- .sass-lint-A.yml
- sub-folder/
- .sass-lint-B.yml
```

**.sass-lint-A.yml**
```yml
options:
config-file: sub-folder/.sass-lint-B.yml
rules:
no-ids: 1
```

**.sass-lint-B.yml**
```yml
rules:
no-ids: 2
no-important: 1
```

**start Sass-lint from the my-project directory**

`sass-lint -c .sass-lint-A.yml`


In the scenario above the first config would load and merge the second config recursively.

The resulting config you could expect would be:

```yml
options:
config-file: sub-folder/.sass-lint-B.yml
rules:
no-ids: 1
no-important: 1
```

Notice how the B config's `no-ids` rule is ignored as we are 'extending' A from B.

There is no limit to how many config files can be loaded, but please do be aware of circular dependencies.

0 comments on commit 9ee2b85

Please sign in to comment.