Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add naming rules doc #13

Merged
merged 4 commits into from
May 8, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/naming-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Naming rules

Rules are:

* Made of lowercase words separated by hyphens.
* Split into two parts:
* The first describes [what thing](http://apps.workflower.fi/vocabs/css/en) the rule applies to.
* The second describes what the rule is enforcing.

```js
selector-max-specificity
^ ^
| |
the thing what the rule is enforcing
```

## No

Most rules *enforce the inclusion or exclusion* of something.

For example, whether there should or shouldn't be a trailing semicolon at the end of a declaration block:

* `declaration-block-trailing-semicolon`: `bool`
* `true` - there *must* be a trailing semicolon
* `false` - there *must not* be a trailing semicolon

If the rule is *disallowing* something use `*-no-*`.

For example, whether empty rule-sets should be disallowed or not:

* `rule-set-no-empty`: `bool`
* `true`: rule-sets *must not* be empty
* `false`: rule-sets *can* be empty (equivalent to not turning the rule on)

In this case it doesn't make sense to enforce that every rule-set *must* be empty.

## Max

If the rule is *setting a limit* to something use `*-max-*`.

For example, specifying the maximum number of digits after the "." in a number

* `number-max-precision`: `int`

## Before and after

If the rule is *specifying what whitespace is allowed* around something then use `*-before/after` and use `coma`, `colon`, `semicolon`, `opening-brace`, `closing-brace`, `opening-parenthesis`, `closing-parenthesis`, `operator` and `range-operator` to identify that something.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two m's in comma :)


For example, what whitespace is allowed before a coma and after the operator in a function:

* `function-coma-before`: `string`
* `function-operator-after`: `string`