diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 12cb276..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "jetpack/addon-sdk"]
- path = jetpack/addon-sdk
- url = git://github.com/mozilla/addon-sdk.git
diff --git a/MANIFEST.in b/MANIFEST.in
index 46d3958..8bed6c7 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,2 @@
include validator/testcases/hashes.txt
-include validator/app_versions.json
-include validator/testcases/jetpack_data.txt
include validator/testcases/whitelist_hashes.txt
diff --git a/README.rst b/README.rst
index 12445b8..2efcc7d 100644
--- a/README.rst
+++ b/README.rst
@@ -1,10 +1,9 @@
-==============================
- addons.mozilla.org Validator
-==============================
+===================================
+ marketplace.mozilla.org Validator
+===================================
-The AMO Validator is a tool designed to scan Mozilla add-on packages for
-problems such as security vulnerabilities, exploits, spamware and badware,
-and lots of other gunk. By using a combination of various techniques and
+The Apps Validator is a tool designed to scan open web apps for
+problems and invalid code. By using a combination of various techniques and
detection mechanisms, the validator is capable of being both efficient as well
as thorough.
@@ -19,7 +18,6 @@ Python Libraries:
- argparse
- cssutils
-- rdflib
- fastchardet
Python Libraries for Testing:
@@ -86,12 +84,10 @@ your environment.
Run the validator as follows ::
- python addon-validator [-t ] [-o
', '>'),
- ('"', '"'), ):
- line = line.replace(old, new)
- if status == '!':
- rows.append('' % (lineno,
- line))
- stats['missed'] += 1
- elif status == '>':
- rows.append('' % (lineno, line))
- stats['covered'] += 1
- else:
- rows.append('' % (lineno, line))
- stats['skipped'] += 1
- stats['percent'] = self.computePercent(stats['covered'],
- stats['missed'])
- html = COVERAGE_TEMPLATE % {'title': '%s' % name,
- 'header': name,
- 'body': '\n'.join(rows),
- 'stats': COVERAGE_STATS_TEMPLATE % stats,
- }
- outfilename = name + '.html'
- outfile = open(os.path.join(outputDir, outfilename), 'w')
- outfile.write(html)
- outfile.close()
- return outfilename, stats
-
- def computePercent(self, covered, missed):
- if covered + missed == 0:
- percent = 1
- else:
- percent = covered/(covered+missed+0.0)
- return int(percent * 100)
-
- def wantModuleCoverage(self, name, module, stream=None):
- if not hasattr(module, '__file__'):
- log.debug("no coverage of %s: no __file__", name)
- return False
- module_file = src(module.__file__)
- if not module_file or not module_file.endswith('.py'):
- log.debug("no coverage of %s: not a python file", name)
- return False
- if self.coverSkip:
- for package in self.coverSkip:
- if name.startswith(package):
- return False
- if self.coverPackages:
- for package in self.coverPackages:
- if (name.startswith(package)
- and (self.coverTests
- or not self.conf.testMatch.search(name))):
- log.debug("coverage for %s", name)
- return True
-
- if name in self.skipModules:
- log.debug("no coverage for %s: loaded before coverage start",
- name)
- return False
- if self.conf.testMatch.search(name) and not self.coverTests:
- log.debug("no coverage for %s: is a test", name)
- return False
- # accept any package that passed the previous tests, unless
- # coverPackages is on -- in that case, if we wanted this
- # module, we would have already returned True
- return not self.coverPackages
-
- def wantFile(self, file, package=None):
- """If inclusive coverage enabled, return true for all source files
- in wanted packages.
- """
- if self.coverInclusive:
- if file.endswith(".py"):
- if package and self.coverPackages:
- for want in self.coverPackages:
- if package.startswith(want):
- return True
- else:
- return True
- return None
diff --git a/extras/unbundle.py b/extras/unbundle.py
deleted file mode 100644
index d26a6be..0000000
--- a/extras/unbundle.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import sys
-import os
-
-import zipfile
-from zipfile import ZipFile
-from StringIO import StringIO
-
-source = sys.argv[1]
-target = sys.argv[2]
-
-if not target.endswith("/"):
- target = "%s/" % target
-
-def _unbundle(path, target):
- zf = ZipFile(path, 'r')
- contents = zf.namelist()
- for item in contents:
- sp = item.split("/")
- if not sp[-1]:
- continue
-
- if "__MACOSX" in item:
- continue
-
- print item, ">", target + item
-
- cpath = target + "/".join(sp[:-1])
- if not os.path.exists(cpath):
- os.makedirs(cpath)
- if item.endswith((".jar", ".xpi", ".zip")):
- now = target + item
- path_item = item.split("/")
- path_item[-1] = "_" + path_item[-1]
- path = target + "/".join(path_item)
-
- buff = StringIO(zf.read(item))
- _unbundle(buff, path + "/")
- else:
- f = open(target + item, 'w')
- f.write(zf.read(item))
- f.close()
- zf.close()
-
-if not os.path.exists(target):
- os.mkdir(target)
-
-_unbundle(source, target)
diff --git a/extras/update_langpacks.py b/extras/update_langpacks.py
deleted file mode 100644
index efa191c..0000000
--- a/extras/update_langpacks.py
+++ /dev/null
@@ -1,72 +0,0 @@
-import os
-from fnmatch import fnmatch
-from tempfile import NamedTemporaryFile
-from zipfile import ZipFile
-
-
-PACKAGE_MAPPINGS = {"Fennec.app": "fennec",
- "Firefox.app": "firefox",
- "SeaMonkey.app": "seamonkey",
- "Thunderbird.app": "thunderbird",}
-
-
-def copy_to_zip(read_zip, write_zip, pattern, prefix=""):
- for member in read_zip.namelist():
- if fnmatch(member, pattern):
- filename = member.split("/")[-1]
- write_zip.writestr("%s%s" % (prefix, filename),
- read_zip.read(member))
-
-
-def copy_to_new_zip(callback, read_zip, pattern, prefix=""):
- with NamedTemporaryFile("w") as temp:
- with ZipFile(temp.name, "w") as write_zip:
- copy_to_zip(read_zip, write_zip, pattern, prefix)
-
- callback(temp.name)
-
-
-def main():
- for package in os.listdir("language_controls/"):
- if package.startswith(".") or package not in PACKAGE_MAPPINGS:
- continue
-
- platform = PACKAGE_MAPPINGS[package]
- path = "language_controls/%s" % package
- jar = ZipFile("../validator/testcases/langpacks/%s.xpi" % platform, "w")
-
- if platform == "firefox":
- # Firefox puts this stuff in omni.ja.
- with ZipFile("%s/Contents/MacOS/omni.ja" % path, "r") as omni_ja:
- #print list(x for x in omni_ja.namelist() if x.startswith("chrome/"))
- jar.writestr("chrome.manifest",
- omni_ja.read("chrome/localized.manifest"))
-
- # Copy the chrome/en-US/ directory to /en-US.jar in the new zip.
- def callback(name):
- jar.write(name, "en-US.jar")
- copy_to_new_zip(callback, omni_ja, "chrome/en-US/*")
-
- elif platform in ("thunderbird", "seamonkey", ):
- # Thunderbird puts stuff in omni.ja, too,
- with ZipFile("%s/Contents/MacOS/omni.ja" % path, "r") as omni_ja:
- jar.writestr("chrome.manifest",
- omni_ja.read("chrome/localized.manifest"))
-
- # Copy the chrome/en-US/ directory to /en-US.jar in the new zip.
- def callback(name):
- jar.write(name, "en-US.jar")
- copy_to_new_zip(callback, omni_ja, "chrome/en-US/*")
-
- else:
- jar.write("%s/Contents/MacOS/chrome/localized.manifest" % path,
- "chrome.manifest")
- jar.write("%s/Contents/MacOS/chrome/en-US.jar" % path,
- "en-US.jar")
-
- jar.close()
-
-
-if __name__ == "__main__":
- main()
-
diff --git a/jetpack/addon-sdk b/jetpack/addon-sdk
deleted file mode 160000
index e2b154a..0000000
--- a/jetpack/addon-sdk
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit e2b154aff5c452d3b4f25bd67513122bd6172319
diff --git a/jetpack/generate_jp_whitelist.sh b/jetpack/generate_jp_whitelist.sh
deleted file mode 100755
index 743f954..0000000
--- a/jetpack/generate_jp_whitelist.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-rm ../validator/testcases/jetpack_data.txt
-
-cd addon-sdk
-git pull origin --tags
-for tagname in `git tag`;
-do
- # Check out the tag.
- git checkout $tagname
-
- # Hash all of the JS files.
- for f in `find . -type f -name "*.js"`;
- do
- python ../make_hash.py $f $tagname >> ../../validator/testcases/jetpack_data.txt
- done
-
- # Run again for HTML, because it gets bundled, too.
- for f in `find . -type f -name "*.html"`;
- do
- python ../make_hash.py $f $tagname >> ../../validator/testcases/jetpack_data.txt
- done
-done
-
-sort ../../validator/testcases/jetpack_data.txt -d -o ../../validator/testcases/jetpack_data.txt
diff --git a/jetpack/make_hash.py b/jetpack/make_hash.py
deleted file mode 100644
index 65041f5..0000000
--- a/jetpack/make_hash.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import hashlib
-import os
-import sys
-
-hash = hashlib.sha256(open(sys.argv[1]).read()).hexdigest()
-print sys.argv[1], sys.argv[2], hash
diff --git a/requirements.txt b/requirements.txt
index 9b63eaf..eee4109 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,8 +1,6 @@
-coverage==3.3.1
cssutils==0.9.7
Fabric==0.9.0
nose==0.11.4
-rdflib==3.2.1
simplejson==2.3.0
argparse==1.1
-e git://github.com/mattbasta/fastchardet#egg=fastchardet
diff --git a/setup.py b/setup.py
index 2eae362..6d2ae4c 100644
--- a/setup.py
+++ b/setup.py
@@ -2,13 +2,13 @@
setup(
- name='amo-validator',
+ name='app-validator',
version='1.0',
- description='Validates addons for Mozilla products.',
+ description='Validates open web apps.',
long_description=open('README.rst').read(),
author='Matt Basta',
author_email='me@mattbasta.com',
- url='http://github.com/mattbasta/amo-validator',
+ url='http://github.com/mattbasta/app-validator',
license='BSD',
packages=find_packages(exclude=['tests',
'tests/*',
@@ -19,7 +19,7 @@
install_requires=[p.strip() for p in open('./requirements.txt')
if not p.startswith(('#',
'-e'))],
- scripts=["addon-validator"],
+ scripts=["app-validator"],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',