Skip to content

Commit

Permalink
Rename headers.tool to tool_name #211
Browse files Browse the repository at this point in the history
As suggested by @sschuberth in
aboutcode-org/aboutcode#7 (comment)

Signed-off-by: Philippe Ombredanne <[email protected]>
  • Loading branch information
pombredanne committed Nov 27, 2018
1 parent 890f127 commit 8858d5c
Show file tree
Hide file tree
Showing 71 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/scancode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def scancode(ctx, input, # NOQA
# update headers
cle = codebase.get_or_create_current_header()
cle.start_timestamp = start_timestamp
cle.tool = 'scancode-toolkit'
cle.tool_name = 'scancode-toolkit'
cle.tool_version = scancode_version
cle.notice = notice
cle.options = get_pretty_params(ctx, generic_paths=test_mode)
Expand Down
4 changes: 2 additions & 2 deletions src/scancode/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Header(object):
Represent a codebase header. Each tool that transforms the codebase
should create a Header and append it to the codebase log_entries list.
"""
tool = String(help='Tool used such as scancode-toolkit.')
tool_name = String(help='Name of the tool used such as scancode-toolkit.')
tool_version = String(default='', help='Tool version used such as v1.2.3.')
options = Mapping(help='Mapping of key/values describing the options used with this tool.')
notice = String(default='', help='Notice text for this tool.')
Expand All @@ -152,7 +152,7 @@ def from_dict(cls, **kwargs):
key/values. Unknown attributes are ignored.
"""
known_attributes = set([
'tool',
'tool_name',
'tool_version',
'options',
'notice',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--email": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/cluecode/data/plugin_email_url/emails.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--email": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/cluecode/data/plugin_email_url/urls.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 5,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 5,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/formattedcode/data/json/simple-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/formattedcode/data/json/simple-expected.jsonlines
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/formattedcode/data/json/simple-expected.jsonpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/formattedcode/data/json/tree/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"files_count": 7,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json-pp": "<file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/altpath/copyright.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/composer/composer.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/failing/patchelf.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/info/all.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 6,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/info/all.rooted.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 6,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/info/basic.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 6,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/info/basic.rooted.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files_count": 6,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/info/email_url_info.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 6,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--email": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/license_text/test.expected
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/non_utf8/expected-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 18,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/non_utf8/expected-mac.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 18,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/non_utf8/expected-win.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 18,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 12,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/plugin_only_findings/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"files_count": 2,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 0,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"files_count": 33,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"tool_version": "2.9.7.post135.90333b4",
"options": {
"input": "samples/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--json": "<file>",
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/single/iproute.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"files_count": 1,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--info": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"files_count": 3,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/scancode/data/weird_file_name/expected-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"files_count": 5,
"headers": [
{
"tool": "scancode-toolkit",
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
Expand Down
Loading

0 comments on commit 8858d5c

Please sign in to comment.