Skip to content

Commit

Permalink
Use libsass instead of pyscss
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Dec 13, 2015
1 parent 661106c commit c5c656b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
sha: 3eb13b9647543ad4d6a62c8be8a9131e3b99b96a
hooks:
- id: scss-lint
files: scss/.*\.scss$
language_version: 1.9.3-p547
- repo: [email protected]:pre-commit/pre-commit-hooks
sha: 516cc9fa72ad09699f2c03ffbd0aa7f60d75b59a
Expand Down
4 changes: 4 additions & 0 deletions .scss-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ linters:
enabled: false
ColorKeyword:
enabled: false
ColorVariable:
enabled: false
Comment:
enabled: false
DeclarationOrder:
Expand All @@ -17,6 +19,8 @@ linters:
enabled: false
MergeableSelector:
force_nesting: false
NestingDepth:
max_depth: 4
PlaceholderInExtend:
enabled: false
PropertySortOrder:
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ env:
after_success:
- bash push_to_gh.sh
sudo: false
cache:
directories:
- $HOME/.cache/pip
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install_pre_commit: py_env
. py_env/bin/activate && pre-commit install

build/main.css: node_env build scss/main.scss scss/_variables.scss
. py_env/bin/activate && pyscss -o build/main.css scss/main.scss
. py_env/bin/activate && sassc -s compressed scss/main.scss build/main.css

all-hooks.json: py_env make_all_hooks.py all-repos.yaml
. py_env/bin/activate && python make_all_hooks.py
Expand Down
8 changes: 4 additions & 4 deletions make_all_hooks.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import collections
import contextlib
import io
import json
import os.path
import shutil
import subprocess
import tempfile

import aspy.yaml
import ordereddict
import simplejson
from pre_commit.clientlib.validate_manifest import load_manifest


Expand All @@ -35,12 +35,12 @@ def get_manifest_from_repo(repo_path):

def main():
repos = aspy.yaml.ordered_load(io.open('all-repos.yaml'))
hooks_json = ordereddict.OrderedDict()
hooks_json = collections.OrderedDict()
for repo in repos:
hooks_json[repo] = get_manifest_from_repo(repo)

with open('all-hooks.json', 'w') as hooks_json_file:
simplejson.dump(hooks_json, hooks_json_file, indent=4)
json.dump(hooks_json, hooks_json_file, indent=4)


if __name__ == '__main__':
Expand Down
8 changes: 4 additions & 4 deletions make_templates.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import collections
import io
import json
import os.path

import mako.lookup
import ordereddict
import simplejson


template_lookup = mako.lookup.TemplateLookup(
Expand All @@ -23,9 +23,9 @@


def get_env():
all_hooks = simplejson.loads(
all_hooks = json.loads(
io.open('all-hooks.json').read(),
object_pairs_hook=ordereddict.OrderedDict,
object_pairs_hook=collections.OrderedDict,
)

return {'all_hooks': all_hooks}
Expand Down
5 changes: 1 addition & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
aspy.yaml
flake8
mako
libsass
nodeenv
ordereddict
pylint
pyscss
pre-commit
simplejson
virtualenv

0 comments on commit c5c656b

Please sign in to comment.