mozbuild.code_analysis package

Submodules

mozbuild.code_analysis.mach_commands module

class mozbuild.code_analysis.mach_commands.StaticAnalysisMonitor(srcdir, objdir, checks, total)

Bases: object

property current_file
property num_files
property num_files_processed
on_line(line)
property warnings_db
class mozbuild.code_analysis.mach_commands.StaticAnalysisSubCommand(command, subcommand, description=None, parser=None, metrics_path: str | None = None, virtualenv_name: str | None = None)

Bases: SubCommand

mozbuild.code_analysis.mach_commands.autotest(command_context, verbose=False, dump_results=False, intree_tool=False, checker_names=[])
mozbuild.code_analysis.mach_commands.build_repo_relative_path(abs_path, repo_path)

Build path relative to repository root

mozbuild.code_analysis.mach_commands.check(command_context, source=None, jobs=2, strip=1, verbose=False, checks='-*', fix=False, header_filter='', output=None, format='text', outgoing=False)
mozbuild.code_analysis.mach_commands.clang_format(command_context, assume_filename, path, commit, output_path=None, output_format='diff', verbose=False, outgoing=False)
mozbuild.code_analysis.mach_commands.clang_tidy(command_context)

Detailed documentation: https://firefox-source-docs.mozilla.org/code-quality/static-analysis/index.html

mozbuild.code_analysis.mach_commands.clear_cache(command_context, verbose=False)
mozbuild.code_analysis.mach_commands.get_abspath_files(command_context, files)
mozbuild.code_analysis.mach_commands.get_clang_tidy_config(command_context)
mozbuild.code_analysis.mach_commands.get_clang_tools(command_context, force=False, skip_cache=False, source=None, download_if_needed=True, verbose=False)
mozbuild.code_analysis.mach_commands.get_files_with_commands(command_context, compile_db, source)

Returns an array of dictionaries having file_path with build command

mozbuild.code_analysis.mach_commands.install(command_context, source=None, skip_cache=False, force=False, verbose=False)
mozbuild.code_analysis.mach_commands.prettier_format(command_context, path, assume_filename)
mozbuild.code_analysis.mach_commands.print_checks(command_context, verbose=False)
mozbuild.code_analysis.mach_commands.prompt_bool(prompt, limit=5)

Prompts the user with prompt and requires a boolean value.

mozbuild.code_analysis.mach_commands.run_one_clang_format_batch(args)
mozbuild.code_analysis.mach_commands.static_analysis(command_context)

Detailed documentation: https://firefox-source-docs.mozilla.org/code-quality/static-analysis/index.html

mozbuild.code_analysis.utils module

class mozbuild.code_analysis.utils.ClangTidyConfig(mozilla_src)

Bases: object

checks

A specialized version of the memoize decorator that works for class instance properties.

checks_config

A specialized version of the memoize decorator that works for class instance properties.

checks_with_data

A specialized version of the memoize decorator that works for class instance properties.

platforms

A specialized version of the memoize decorator that works for class instance properties.

version

A specialized version of the memoize decorator that works for class instance properties.

Module contents