Π“Ρ€Π°Ρ„ ΠΊΠΎΠΌΠΌΠΈΡ‚ΠΎΠ²

42 ΠšΠΎΠΌΠΌΠΈΡ‚ΠΎΠ²

Автор SHA1 Π‘ΠΎΠΎΠ±Ρ‰Π΅Π½ΠΈΠ΅ Π”Π°Ρ‚Π°
Hemanth Kumar Veeranki 1fcb79d95d Replace singleLineString with common-tags equivalent
Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
2017-08-12 11:30:15 +05:30
Stuart Colville 6109428a06 Configure amo eslint config (#1451)
* Sync lockfile

* Add and setup amo eslint config

* Use Array.prototype.some instead of loop

* Make test command compare with addons-frontend

* Update README to refer to yarn over npm
2017-08-11 16:49:06 +02:00
Christopher Grebs 91a89f5341 Flag Mozilla conditions of use violation. (#1446)
* Flag Mozilla conditions of use violation.

Fixes #1285

* Performance optimization: initialize regex only once.

This also forwards _console and silents test output.

* Don't match on empty strings

* Fix comment

* Refactor badwords matching to be more performant and simpler.

* Remove trim
2017-08-11 12:58:40 +02:00
Christopher Grebs ae3f000586 Expose total size of "code" files in metadata. (#1430)
* Expose total size of "code" files in metadata.

There is now a new `totalScannedFileSize` property in `addonMetadata`.

Fixes #1304

* Update docstring a bit
2017-07-27 17:56:46 +02:00
Andreas Wagner da14873d76 fix(package): update chalk to version 2.0.1 (#1388)
* fix(package): update chalk to version 2.0.1

Closes #1383

* Remove failing test
2017-07-10 14:54:12 +02:00
Christopher Grebs ef5d62760c Remove sinon imports, it's now a global 2017-06-22 16:03:33 +08:00
Christopher Grebs 0851963606 Convert first batch of tests to use proper sinon.assert api. 2017-06-22 16:00:09 +08:00
Christopher Grebs 1947ffd7fb Switch our test suite to use Jest test runner.
* Fix javascript test to use new eslint rule format.
* Cleanup dependencies, configure runInBand because we are messing with processes and this leads to inconsisten test results / failures
* Add test-ci shortcut to make tests more predictable and simpler (no process magic) on travis.
* Add missing files
* Fix testMatch
* Fix test and test-no-coverage commands
* Fix default value in manifestjson to be the same key as in the parsedJSON later
* Simplify addons linter test
* Add some optimizations
* Rewrite cli-process test to not rely on shell js and make it work with jest.
* Lots of cleanups, fix toThrow tests to check for messages again.
* re-add eslint, remove more stuff from Gruntfile
* Add proper eslintignore file
* Lots of cleanups, fix all remaining eslint problems.
* Do not test our workaround, that'll be a mess...
* Add test that checks for importSchemas to skip certain files.
* activate jest environment, remove custom global entries
* add collectCoverageFrom config
* remove some old, removed, uncovered code.
* more test fixes
* add missing file
2017-06-12 21:33:26 +08:00
Christopher Grebs d4524e34de Overwrite eslint default ignore patterns. (#1296)
* Overwrite eslint default ignore patterns.

This scans node_modules and bower_components. Fixes #1288

* Update test with a bit more docs

* Make link absolute

* Add test to make sure .eslintignorerc is not read too.

* Add mixxing node_modules/foo.js file

* Ignore obvious syntax error in test fixture

* Actually record scanned file names, use them to test.

* Adapt all other tests to new API

* Adapt tests to new api, unify messages naming to 'linterMessages'

* Some more fixes

* Refactor and fix test.rdf.js, fix getContents usage, refs #292

* Refactor and fix test.html.js, fix getContents usage, refs #292

* Fix javascript scanner tests to be compatible with our new api

* Remove eslingignore again, not needed anymore

* filename should be let

* Revert...

* let -> const

* Fix comments, fix some naming

* Smaller refactor to actually test from what scanner a file got scanned.

* Add a few more tests to increase coverage.

* Fix recordScannedFile to not insert the scanner twice.

* Fix duplicate check

* Throw an error if scannerName is not implemented.

* Fix test, add some documentation.

* Document github issue
2017-05-30 17:12:57 +08:00
Andreas Wagner 2ff08629e1 fix(package): update dispensary to version 0.10.7 (#1275)
* fix(package): update dispensary to version 0.10.7

Closes #1274

* Fixup tests
2017-05-09 15:30:37 +02:00
Luca Greco e7170ad340 fix: Linter.run should resolve to the linting results object 2017-05-04 22:28:53 +02:00
Luca Greco a99d44f33d docs: Added notes on API integration 2017-03-15 20:13:57 +01:00
Jakub Wilk 67deffee38 Fix spelling of MULTIPLE_MANIFESTS 2017-03-05 13:37:27 +01:00
Luca Greco 974c068a54 feat: Added a --scan-file option to scan a single file 2017-02-02 18:33:55 +01:00
Stuart Colville ec30f17f9a Fix lint 2016-11-23 22:52:27 +00:00
Kumar McMillan 9b47e499a3 prevent linter from parsing yargs options (#1037) 2016-11-07 15:49:23 -06:00
Matthew Riley MacPherson 23748e4a5e Scan all JSON files (close #779)
This turned out to be a lot more work than I thought it'd be, because
of how we were scanning manifest.json files.

Now we scan all JSON files, so anything that would throw Firefox for a loop
should be caught by the linter.
2016-08-22 12:12:17 +01:00
Kumar McMillan 797a5257e6 Add callback to control which files can be scanned (#862)
* Add callback to control which files can be scanned

* Filter all files, including topmost directory

* Switch to arrow function
2016-08-03 14:53:08 -05:00
Rob Wu 936f263c18 Use constants instead of strings in tests 2016-07-25 14:23:14 +01:00
Christopher Grebs a752be1e20 Report known js libraries. (#809)
Report known js libraries.

This is something the amo-validator does so we need that
for compatibility reasons.

Refs mozilla/addons-server#3015
2016-07-05 13:25:04 +02:00
Matthew Riley MacPherson b377d7993f Improve fixtures making them webextensions (fix #798) 2016-07-01 16:30:57 +01:00
Andreas Wagner fa4b38343b Do not scan known third party libraries 2016-06-10 00:09:38 +02:00
tofumatt β˜•οΈ 60d7d170f3 Merge pull request #731 from mozilla/flag-large-files-730
Flag large files (fix #730)
2016-06-07 14:49:20 -04:00
Matthew Riley MacPherson d536b9a883 Flag large files (fix #730) 2016-06-07 14:38:15 -04:00
Matthew Riley MacPherson 882d0698a4 Validate a CRX file (close #696) 2016-06-06 21:00:38 -04:00
Andreas Wagner bc169ecb3b Update unadvised libs with more robust test 2016-05-26 14:49:12 +02:00
Matthew Riley MacPherson 778aa4334f Add extra angular libs 2016-05-25 14:55:40 -04:00
Matthew Riley MacPherson 86f4dfb443 Create warning and error list for third-party JS libraries
Fix #598
2016-05-25 14:55:15 -04:00
Peter deHaan 2313ba071f Sort ESLint rules and fix Grunt scripts
Bump grunt dependency and extend eslint:recommended rules

Remove jscs meta and address review feedback

Remove last JSCS references from source/docs
2016-05-19 12:25:07 -07:00
Andy McKay 49de7b2702 fix let mistake in test 2016-05-13 17:59:20 -07:00
Andy McKay 7ae74e7274 warn if already signed 2016-05-13 13:19:45 -07:00
Andy McKay 899b15908c flag by file extension or magic number 2016-05-03 16:15:06 -07:00
Andy McKay 24bc25e76d create a hidden scanner that triggers for hidden files and throws a warning, if asked to scan the file 2016-04-22 10:47:35 -07:00
Andy McKay 24fe588691 scan every file and add a null pass through, also remove loop 2016-04-21 21:52:24 -07:00
Andy McKay 9d0e33f77b fail if both install.rdf and manifest.json defined 2016-04-21 08:57:05 -07:00
Andy McKay 6ef8725dcf warn about a missing manifest.json 2016-04-20 12:41:11 -07:00
Stuart Colville 11db2fa802 Catch end of central directory record not found 2016-03-16 16:07:28 +01:00
Stuart Colville 249fd271f5 Add metadata to scan output JSON 2016-03-15 13:28:49 +01:00
Matthew Riley MacPherson 01547eb51a Integrate dispensary; remove filehasher (close #475) 2016-02-05 13:29:50 +00:00
Stuart Colville 60da53461d Remove type detection fallback 2016-01-05 09:26:54 +00:00
Stuart Colville 3b2f8a31b9 Move to babel 6.0 2015-12-15 14:08:58 +00:00
Matthew Riley MacPherson 071d2b5540 Change validator to linter (fix #397) 2015-12-11 14:36:42 -05:00