-
Notifications
You must be signed in to change notification settings - Fork 1
JSON Output: Python
Below is the outline of JSON object outputs for Python. Variables in < > characters will be replaced by the corresponding data. The expected results type is written in ( ) characters for each value, followed by a # character with any additional comments.
The "pep" and "google" values are booleans indicating whether all occurrences of that style element are compliant to the PEP 8 and Google style guide recommendations, respectively. Due to restrictions of the APIs utilized in this project, all occurrences of that style element must perfectly follow the style guides to be considered compliant. For example, if one class definition is named in lowercase instead of CapWords, then "pep" is false for the the class naming section.
See the example output for more information.
Each file is saved with the key "<owner name>/<repo name>"
{
"node_id": (string),
"name": (string),
"full_name": (string),
"owner": {
"login": (string),
"node_id": (string),
"url": (string),
"html_url": (string),
"type": (string)
},
"private": (boolean),
"html_url": (string),
"url": (string),
"size": (int),
"language": (string or null),
"organization": (JSON or null), // If Organization is not null, it will be formatted like Owner
"repo_analysis": {
"summary": {
"file_count": (int), // The number of files in the repository
"analyzed_file_count": (int), // The number of files analyzed
"total_repo_errors": (int) // The sum of the number of errors in the entire repository
"total_category_errors": {
"naming": (int), // The sum of the number of naming errors in the entire repository
"indentation": (int), // The sum of the number of indentation errors in the entire repository
"tabs_vs_spaces": (int), // The sum of the number of tabs vs. spaces errors in the entire repository
"line_length": (int), // The sum of the number of line length errors in the entire repository
"blank_lines": (int), // The sum of the number of blank line errors in the entire repository
"imports": (int) // The sum of the number of import errors in the entire repository
}
}
"<file path>": { // Note: the file extension has been stripped from the path due to MongoDB key rules
"file_name": (string),
"file_path": (string),
"sha": (string),
"size": (int),
"node_id": (string),
"url": (string),
"date_processed": (string), // The date and time this file was analyzed
"total_file_errors": (int), // The sum of the number of errors in every category
"naming_analysis": {
"classes": {
"definitions": (int), // The number of class definitions in this file
"pep": (boolean), // True if entire file is compliant to PEP 8. False otherwise
"google": (boolean), // True if entire file is compliant to Google. False otherwise
"occurrences": (int) // The number of class names that violate naming rules
},
"functions": {
"definitions": (int), // The number of function and method definitions in this file
"pep": (boolean),
"google": (boolean),
"occurrences": (int)
}
},
"indentation_analysis": {
"pep": (boolean),
"google": (boolean),
"errors": (JSON or null) {
"<error code>": (int),
"<error code>": (int)
}
},
"tabs_vs_spaces_analysis": {
"pep": (boolean),
"google": (boolean),
"errors": (JSON or null)
},
"line_length_analysis": {
"pep": (boolean),
"google": (boolean),
"errors": (JSON or null)
},
"blank_lines_analysis": {
"pep": (boolean),
"google": (boolean),
"errors": (JSON or null)
},
"imports_analysis": {
"pep": (boolean),
"google": (boolean),
"errors": (JSON or null)
},
"file_encoding_analysis": null
}
}
}
Here is an example JSON output for two files in rstojnic's lazydata repository.
{
"rstojnic/lazydata": {
"_id": "MDEwOlJlcG9zaXRvcnkxNDU1NjI3NTc=",
"node_id": "MDEwOlJlcG9zaXRvcnkxNDU1NjI3NTc=",
"name": "lazydata",
"full_name": "rstojnic/lazydata",
"owner": {
"login": "rstojnic",
"node_id": "MDQ6VXNlcjcyODk4Nzg=",
"url": "https://api.github.com/users/rstojnic",
"html_url": "https://github.com/rstojnic",
"type": "User"
},
"private": false,
"html_url": "https://github.com/rstojnic/lazydata",
"url": "https://api.github.com/repos/rstojnic/lazydata",
"size": 266,
"language": "Python",
"organization": null,
"repo_analysis": {
"summary": {
"file_count": 40,
"analyzed_file_count": 23,
"total_repo_errors": 109,
"total_category_errors": {
"naming": 0,
"indentation": 0,
"tabs_vs_spaces": 0,
"line_length": 94,
"blank_lines": 12,
"import": 3
}
},
"master/lazydata/storage/remote": {
"file_name": "lazydata/storage/remote.py",
"file_path": "lazydata/master/lazydata/storage/remote.py",
"sha": "e1caf54e763aabccee7927263e92b5799fb875fc",
"size": 9255,
"node_id": "MDQ6QmxvYjE0NTU2Mjc1NzplMWNhZjU0ZTc2M2FhYmNjZWU3OTI3MjYzZTkyYjU3OTlmYjg3NWZj",
"url": "https://api.github.com/repos/rstojnic/lazydata/git/blobs/e1caf54e763aabccee7927263e92b5799fb875fc",
"date_processed": "2018-11-28 22:37:40.036470",
"total_file_errors": 31,
"naming_analysis": {
"classes": {
"definitions": 4,
"pep": true,
"google": true,
"occurrences": 0
},
"functions": {
"definitions": 14,
"pep": true,
"google": true,
"occurrences": 0
}
},
"indentation_analysis": {
"pep": true,
"google": true,
"errors": null
},
"tabs_vs_spaces_analysis": {
"pep": true,
"google": true,
"errors": null
},
"line_length_analysis": {
"pep": false,
"google": false,
"errors": {
"E501": 25
}
},
"blank_lines_analysis": {
"pep": false,
"google": false,
"errors": {
"E302": 1,
"E303": 2
}
},
"import_analysis": {
"pep": false,
"google": false,
"errors": {
"E401": 1,
"E402": 2
}
},
"file_encoding_analysis": null
}
}
}
}