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

New plugin architecture #885

Merged
merged 122 commits into from
Feb 7, 2018
Merged
Changes from 1 commit
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
065d0a3
Support multiple options for pre-scan plugins #787
yashdsaraf Nov 16, 2017
6095fb1
Added MakeHuman Exception License
SaravananOffl Nov 14, 2017
4f0475c
formatted LICENSE file and removed rules
SaravananOffl Nov 14, 2017
5a304fd
Refactor post scan plugins so they can have command line options
Nov 23, 2017
f41bca6
Improve documentation of PostScanPlugin.process_results()
Nov 24, 2017
403b1b2
Rename get_click_options() to get_options()
Nov 24, 2017
5f4c626
Allow post-scan plugins to take options other than boolean flags
Nov 24, 2017
612cf68
Use a common BasePlugin class for all plugins #787
pombredanne Dec 10, 2017
b765432
Inline fileutils imports #787
pombredanne Jan 2, 2018
7f9b74c
Use proper import in prep for Python 3 #787
pombredanne Jan 2, 2018
cff89ad
Update help text test to match latest code #787
pombredanne Jan 2, 2018
75908e7
Use class method for get_plugin_options #787
pombredanne Jan 2, 2018
586d392
Use scans_cache_class not scan_cache_class #787
pombredanne Jan 2, 2018
66ec6dc
Extract function to get_cache_dir #787
pombredanne Jan 2, 2018
81780ea
Ensure all tests pass #787
pombredanne Jan 2, 2018
d9f8ec1
Remove junk print statements
pombredanne Jan 3, 2018
4f143b7
Streamline core CLI and plugins processing
pombredanne Jan 3, 2018
7ef1cba
Use resource_iter everywhere #787
pombredanne Jan 5, 2018
a6446c9
Do not use on-disk file log. Improve pre-scan plugins #787
pombredanne Jan 5, 2018
0c3625b
Add new extract_zip_raw test function
pombredanne Jan 5, 2018
9884c9f
Bump attrs and add typing library #787
pombredanne Jan 5, 2018
f8eabb3
Make info a regular scan and other CLI loop reorg #787
pombredanne Jan 6, 2018
40835fd
Remove diag arg from get_resources() #787
pombredanne Jan 6, 2018
3be4577
Add function to skip first or last iterable item #787
pombredanne Jan 10, 2018
b5e627c
Change interruptible returned values #787
pombredanne Jan 11, 2018
e9cd4e5
Ensure api function return a list #787
pombredanne Jan 11, 2018
59bef89
Use latest attrs and typing #787
pombredanne Jan 11, 2018
683ca26
Add file base_name to info scans #787
pombredanne Jan 12, 2018
0279764
Replace path_to_bytes/unicode by fsen/decode #787
pombredanne Jan 12, 2018
4ba3b77
Improve base plugins design #787
pombredanne Jan 12, 2018
9613d65
Refine scan utilities
pombredanne Jan 12, 2018
e891d07
Use fsencode/fsdecode throughout #787
pombredanne Jan 12, 2018
261fcb9
Improve Codebase and Resource implementation #787
pombredanne Jan 12, 2018
45cf069
Use a Codebase in pre-scan and post-scan plugins #787
pombredanne Jan 12, 2018
b1949e9
Resources are now topdown and sorted by name in outputs #787
pombredanne Jan 12, 2018
da79dc2
Improve plugins and codebase handling in cli #787
pombredanne Jan 12, 2018
024072c
Ensure SPDX RDF tests are always sorted #787
pombredanne Jan 12, 2018
c5014c7
Simplify Plugin init arguments
pombredanne Jan 12, 2018
1095bf3
Update test data #787
pombredanne Jan 16, 2018
60dc3fd
Update test to use new format options #787
pombredanne Jan 16, 2018
4d0d7e3
Update functions doc #787
pombredanne Jan 16, 2018
7428299
Add new timed function decorator to time execution #787
pombredanne Jan 16, 2018
6f1ddd2
Improve handling of re._MAXCACHE
pombredanne Jan 17, 2018
c6a0317
Restore correct SPDX output tests results #787
pombredanne Jan 17, 2018
f5c7a97
Add new plugin system for output #787 #789
pombredanne Jan 17, 2018
b160cd7
Add new output_filter stage and plugins #787
pombredanne Jan 17, 2018
a19d625
Add new housekeeping stage and plugins #787
pombredanne Jan 17, 2018
861e9a1
Add new scan stage and plugins #787 #552 #698
pombredanne Jan 17, 2018
5b5c85c
Add new output_filter stage and plugins #787
pombredanne Jan 17, 2018
c7ec297
Update pre and post-scan plugins to new architecture
pombredanne Jan 17, 2018
60bdb24
New plugin and CLi architecture #787 #552
pombredanne Jan 17, 2018
72bfdbd
Fix typo in configure message
pombredanne Jan 18, 2018
f66f13d
Update release script output options #787
pombredanne Jan 18, 2018
d69e959
Improve CLI options handling #787
pombredanne Jan 18, 2018
43cd8cb
Rename Pluggy impl spec from output to output_impl #787
pombredanne Jan 19, 2018
d7fb3ed
Fix spacing #787
pombredanne Jan 19, 2018
04159b9
Catch errors in the execution of scan stages #787
pombredanne Jan 19, 2018
a1c7053
Refine comment on temp file usage
pombredanne Jan 19, 2018
ab4a3a0
Remove housekeeping stage which is not needed #787
pombredanne Jan 19, 2018
66047ac
Implement new cache and temp_dir #685 #357
pombredanne Jan 23, 2018
2d4aa6b
Cosmetic
pombredanne Jan 23, 2018
73cea2a
Make license reindex use default cache for now #685 #357
pombredanne Jan 23, 2018
6285f0e
Add test for compute_counts
pombredanne Jan 23, 2018
533ff36
Use correct location for version file #685 #357
pombredanne Jan 23, 2018
43ba290
Use proper plugin name for only-findings
pombredanne Jan 23, 2018
f2fe20f
Use proper name for setup stage #787
pombredanne Jan 23, 2018
cefb0f6
Use proper name for setup stage #787
pombredanne Jan 23, 2018
92de6c6
Simplify only-findings codebase.walk #685 #357
pombredanne Jan 23, 2018
0b30649
Correct codebase.compute_counts #685 #357
pombredanne Jan 23, 2018
fae1e76
Do not reindex licenses during configure #685 #357
pombredanne Jan 24, 2018
01a87b6
Prefix all temp dirs with "scancode-" configure #685 #357
pombredanne Jan 24, 2018
45a080a
Use cache_dir and SCANCODE_DEV_MODE correctly #685 #357
pombredanne Jan 24, 2018
2c94a70
Add setup() to plugin_license #685 #357
pombredanne Jan 24, 2018
aeef8f9
Remove SCANCODE_DEBUG_LICENSE env var. Not used
pombredanne Jan 24, 2018
cdd4179
Use cache_dir and SCANCODE_DEV_MODE correctly #685 #357
pombredanne Jan 24, 2018
d00b75d
Improve license matching thresholds #889
pombredanne Jan 24, 2018
b34989c
Fix scan logging #787
pombredanne Jan 24, 2018
622c5a0
Compute stage and scan timing correctly #787
pombredanne Jan 24, 2018
69d2bc6
Ensure that the new --timing CLI options works #787
pombredanne Jan 24, 2018
ac28e69
Use posix paths for tests on all OSes #787
pombredanne Jan 24, 2018
9230d81
Make scancode_config._create_dir work on Win #685 #357
pombredanne Jan 24, 2018
017bc81
Add extra timeout for failing windows tests #685 #357
pombredanne Jan 24, 2018
0efe66c
Add extra timeout for failing windows tests #685 #357
pombredanne Jan 24, 2018
911e8cb
Add extra debug infor for failing windows tests #685 #357
pombredanne Jan 24, 2018
2efcd99
Ensure that to_dict works with not-set values #787
pombredanne Jan 25, 2018
ca2621f
Use less deep path on Windows
pombredanne Jan 25, 2018
8d77d0a
Shorten cpoyright test file names for Windows #787
pombredanne Jan 25, 2018
3639ac9
Correct test failures #787 #685 #357
pombredanne Jan 26, 2018
1d8a43d
Make multiprocessing working on Windows #787 #685 #357
pombredanne Jan 26, 2018
e7aabf1
Use NOQA tags consistently. Cleanup up dead code
pombredanne Jan 26, 2018
481f9e1
Improve CLI help text
pombredanne Jan 26, 2018
5c6eae5
Improve scan test run calls. Cleanup and format code
pombredanne Jan 26, 2018
e8d0df7
Rename test files to work on Windows
pombredanne Jan 26, 2018
9981c63
Do not use expectedFailure on XPASS tests
pombredanne Jan 26, 2018
352507b
Remove Windows-specific test timeouts #787
pombredanne Jan 26, 2018
228143a
Bump help for Windows Python version
pombredanne Jan 26, 2018
93ee491
Reset expectedFailure for Windows tests
pombredanne Jan 26, 2018
21f86a6
Add debug print for Windows test failure
pombredanne Jan 26, 2018
2938852
Avoid using multiple processes in tests #787
pombredanne Jan 26, 2018
715e39d
Update Windows test expectations for failures
pombredanne Jan 26, 2018
cf278a8
Fix typoe in docstring
pombredanne Jan 26, 2018
f66a1fd
Ensure some failing tests run verbosely
pombredanne Jan 26, 2018
74797bc
Fix Windows unicode path test expectations
pombredanne Jan 26, 2018
1a4284b
Fix tracing output
pombredanne Jan 26, 2018
0ad11fe
Re-enable license cache warmup
pombredanne Jan 26, 2018
403e80c
Remove unused plugin test mode code
pombredanne Jan 26, 2018
877c03e
Correct bug in display of non-ascii progressbar
pombredanne Jan 26, 2018
cec427d
Allow scan attributes to be direct Resource attributes #787
pombredanne Feb 1, 2018
29d289b
Correct formatting of CSV outputs
pombredanne Feb 1, 2018
01c635f
Do not regen in tests
pombredanne Feb 1, 2018
cfa3f56
Correct API tests
pombredanne Feb 1, 2018
37fc25d
Fix comment grammar
pombredanne Feb 1, 2018
dc1c997
Add new simple splitext function working from a name
pombredanne Feb 1, 2018
fc2176a
Correct splitext_name function name in doctests
pombredanne Feb 2, 2018
8b4e46d
Remove obsolete TODO
pombredanne Feb 5, 2018
b8faffd
Correct codebasse cache handling at boundaries
pombredanne Feb 6, 2018
e7a06ee
Add convenience methods to Resource
pombredanne Feb 6, 2018
5c9f963
Do not trace copyrights with nltk by default
pombredanne Feb 6, 2018
439ad76
Correct brokrn archives error reporting
pombredanne Feb 6, 2018
141f445
Improve user feedback for missing plugins #787
pombredanne Feb 6, 2018
cf31564
Update test expectation for Windows
pombredanne Feb 6, 2018
5784b20
Update test expectation for macOS
pombredanne Feb 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use scans_cache_class not scan_cache_class #787
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Jan 17, 2018
commit 586d392018e72b02f93ce5e5b809a2f72e698c3c
8 changes: 4 additions & 4 deletions src/scancode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class Resource(object):
information" and the scanned data details.
"""

def __init__(self, scan_cache_class, abs_path, base_is_dir, len_base_path):
self.scan_cache_class = scan_cache_class()
def __init__(self, scans_cache_class, abs_path, base_is_dir, len_base_path):
self.scans_cache_class = scans_cache_class()
self.is_cached = False
self.abs_path = abs_path
self.base_is_dir = base_is_dir
Expand All @@ -62,13 +62,13 @@ def put_info(self, infos):
Cache file info and set `is_cached` to True if already cached or false otherwise.
"""
self.infos.update(infos)
self.is_cached = self.scan_cache_class.put_info(self.rel_path, self.infos)
self.is_cached = self.scans_cache_class.put_info(self.rel_path, self.infos)

def get_info(self):
"""
Retrieve info from cache.
"""
return self.scan_cache_class.get_info(self.rel_path)
return self.scans_cache_class.get_info(self.rel_path)


def extract_archives(location, recurse=True):
Expand Down