lookout.style.format.benchmarks.generate_smoke

A module for repositories generation with different styles in different branches.

Module Contents

exception lookout.style.format.benchmarks.generate_smoke._NoChangesException

Bases:Exception

Exception should be raised if no changes were made to initial code.

lookout.style.format.benchmarks.generate_smoke.index_filename = index.csv
lookout.style.format.benchmarks.generate_smoke.js_operators = ['+', '-', '*', '/', '%', '++', '--', '=', '+=', '-=', '/=', '%=', '==', '===', '!=', '!==', '>', '<', '>=', '<=', '&', '|', '~', '^', '>>', '<<', '>>>', '&&', '||', '!', '?', ':']
lookout.style.format.benchmarks.generate_smoke.js_operators_regex
lookout.style.format.benchmarks.generate_smoke.js_format_rules
lookout.style.format.benchmarks.generate_smoke.commit_style(repo:Repo, format_rule_name:str)

Call bash script which commit all changes to style_name branch and checkout master back.

Parameters:
  • repo – Repo instance to the repository for which style were applied.
  • format_rule_name – Applied format rule name.
Returns:

Two commit hashes: where style was applied and where style was disrupt.

lookout.style.format.benchmarks.generate_smoke.generate_smoke_entry(inputpath:str, outputpath:str, force:bool=False)

Generate repositories with different style in separate branches and its violations.

Parameters:
  • inputpath – Path to the tar.gz archive containing initial repositories.
  • outputpath – Path to the directory where the generated dataset should be stored.
  • force – Override outputpath directory if exists.
Returns:

Success status. 0 if Succeeded, 1 otherwise.