Command to vendor csslint

This commit is contained in:
Kovid Goyal 2020-01-08 21:01:59 +05:30
parent c842e34589
commit f686647286
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 10939 additions and 1 deletions

10898
resources/csslint.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ __all__ = [
'upload_user_manual', 'upload_demo', 'reupload', 'upload_user_manual', 'upload_demo', 'reupload',
'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas', 'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas',
'linux', 'linux32', 'linux64', 'win', 'win32', 'win64', 'osx', 'build_dep', 'linux', 'linux32', 'linux64', 'win', 'win32', 'win64', 'osx', 'build_dep',
'export_packages', 'hyphenation' 'export_packages', 'hyphenation', 'csslint'
] ]
from setup.installers import Linux, Win, OSX, Linux32, Linux64, Win32, Win64, ExtDev, BuildDep, ExportPackages from setup.installers import Linux, Win, OSX, Linux32, Linux64, Win32, Win64, ExtDev, BuildDep, ExportPackages
@ -39,6 +39,9 @@ get_translations = GetTranslations()
iso639 = ISO639() iso639 = ISO639()
iso3166 = ISO3166() iso3166 = ISO3166()
from setup.csslint import CSSLint
csslint = CSSLint()
from setup.build import Build from setup.build import Build
build = Build() build = Build()

37
setup/csslint.py Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import shutil
import subprocess
from setup import Command
class CSSLint(Command):
# We cant use the released copy since it has not had a release in years and
# there are several critical bug fixes we need
description = 'Update the bundled copy of csslint'
NAME = 'csslint.js'
DOWNLOAD_URL = 'https://github.com/CSSLint/csslint.git'
@property
def vendored_file(self):
return os.path.join(self.RESOURCES, self.NAME)
def run(self, opts):
self.clean()
with self.temp_dir() as dl_src:
subprocess.check_call(['git', 'clone', '--depth=1', self.DOWNLOAD_URL], cwd=dl_src)
src = self.j(dl_src, 'csslint')
subprocess.check_call(['npm', 'install'], cwd=src)
shutil.copyfile(self.j(src, 'dist', self.NAME), self.vendored_file)
def clean(self):
if os.path.exists(self.vendored_file):
os.remove(self.vendored_file)