makelint package¶
Module contents¶
-
class
makelint.
DependencyItem
(path, digest, name)¶ Bases:
tuple
-
digest
¶ Alias for field number 1
-
name
¶ Alias for field number 2
-
path
¶ Alias for field number 0
-
-
makelint.
cat_log
(logfile_path, header, merged_log)[source]¶ Copy the content from logfile_path into merged_log
-
makelint.
depmap_is_uptodate
(target_tree, relpath_file)[source]¶ Given a dictionary of dependency data, return true if all of the files listed are unchanged since we last ran the scan.f
-
makelint.
digest_file
(source_path, digest_path)[source]¶ Compute a message digest of the file content, write the digest (in hexadecimal ascii encoding) to the output file
-
makelint.
digest_sourcetree_content
(source_tree, target_tree, progress, njobs)[source]¶ The sha1 of each tracked file is computed and stored in a digest file (one per source file). The digest file depends on the modification time of the source file. If the sourcefile hasn’t changed, the digest file doesn’t need to be updated.
-
makelint.
discover_sourcetree
(source_tree, target_tree, exclude_patterns, include_patterns, progress)[source]¶ The discovery step performs a filesystem walk in order to build up an index of files to be checked. You can use configuration files to setup inclusion and exclusion filters for the discovery process. In general, though, each directory that is scanned produces a list of files to lint. If the timestamp of a tracked directory changes, it is rescanned for new files, or new directories.
The output of the discovery phase is a manifest file per-directory tracked. The creation of this manifest depends on the modification time of the directory it corresponds to and will be re-built if the directory is changed. If a new subdirectory is added, the system will recursively index that new directory. If a directory is removed, it will recursively purge that directory from the manifest index.
-
makelint.
execute_tool_ontree
(source_tree, target_tree, tool, env, fail_fast, merged_log, progress, njobs)[source]¶ Execute the given tool
-
makelint.
get_progress_bar
(numchars, fraction=None, percent=None)[source]¶ Return a high resolution unicode progress bar
-
makelint.
map_dependencies
(source_tree, target_tree, source_relpath)[source]¶ Get a dependency list from the sourcefile. Writeout the dependency file and it’s sha1 digest.
-
makelint.
map_sourcetree_dependencies
(source_tree, target_tree, progress, njobs)[source]¶ During this phase each tracked source file is indexed to get a complete dependency footprint. Note that this is done by importing each module file in a clean interpreter process, and then inspecting the __file__ attribute of all modules loaded by interpreter.
Submodules¶
makelint.configuration module¶
-
class
makelint.configuration.
ConfigObject
[source]¶ Bases:
object
Provides simple serialization to a dictionary based on the assumption that all args in the __init__() function are fields of this object.
-
class
makelint.configuration.
Configuration
(include_patterns=None, exclude_patterns=None, source_tree=None, target_tree=None, tools=None, env=None, fail_fast=False, merge_log=None, quiet=False, jobs=None, **extra)[source]¶ Bases:
makelint.configuration.ConfigObject
Encapsulates various configuration options/parameters
-
class
makelint.configuration.
SimpleTool
(name)[source]¶ Bases:
object
Simple implementation of the tool API that works for commands which just take the name of the file as an argument.
makelint.get_dependencies module¶
Helper module to get dependencies. exec() a python file and then inspect
sys.modules
and record everything that was read in.
makelint.__main__ module¶
Incremental execution system for python code analysis (linting).
-
makelint.__main__.
add_config_options
(optgroup)[source]¶ Add configuration options as flags to the argument parser
-
makelint.__main__.
dump_config
(args, config_dict, outfile)[source]¶ Dump the default configuration to stdout