repo: run codespell

Run codespell and replace known misspelling.

Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Change-Id: I6bfcf67b27745c98059a433c929af637f9a02d8e
diff --git a/tfm_ci_pylib/lava_rpc_connector.py b/tfm_ci_pylib/lava_rpc_connector.py
index e6c391e..283fd25 100644
--- a/tfm_ci_pylib/lava_rpc_connector.py
+++ b/tfm_ci_pylib/lava_rpc_connector.py
@@ -69,7 +69,7 @@
         super(LAVA_RPC_connector, self).__init__(server_addr)
 
     def _rpc_cmd_raw(self, cmd, params=None):
-        """ Run a remote comand and return the result. There is no constrain
+        """ Run a remote command and return the result. There is no constrain
         check on the syntax of the command. """
 
         cmd = "self.%s(%s)" % (cmd, params if params else "")
@@ -196,7 +196,7 @@
         return self.scheduler.job_state(job_id)["job_state"]
 
     def cancel_job(self, job_id):
-        """ Cancell job with id=job_id. Returns True if successfull """
+        """ Cancel job with id=job_id. Returns True if successful """
 
         return self.scheduler.jobs.cancel(job_id)
 
diff --git a/tfm_ci_pylib/structured_task.py b/tfm_ci_pylib/structured_task.py
index 5e44481..80119d9 100644
--- a/tfm_ci_pylib/structured_task.py
+++ b/tfm_ci_pylib/structured_task.py
@@ -2,7 +2,7 @@
 
 """ structured_task.py:
 
-    A generic abstraction class for executing a task with prerequesites and
+    A generic abstraction class for executing a task with prerequisites and
     post execution action """
 
 from __future__ import print_function
@@ -62,7 +62,7 @@
 
     @abc.abstractmethod
     def pre_exec(self, eval_ret):
-        """ Tasks that set-up execution enviroment """
+        """ Tasks that set-up execution environment """
 
     @abc.abstractmethod
     def task_exec(self):
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index 7ebf157..cbc4ecd 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -2,7 +2,7 @@
 
 """ tfm_build_manager.py:
 
-    Controlling class managing multiple build configruations for tfm """
+    Controlling class managing multiple build configurations for tfm """
 
 from __future__ import print_function
 from json import tool
@@ -157,7 +157,7 @@
         """ """
 
     def override_tbm_cfg_params(self, config, override_keys, **params):
-        """ Using a dictionay as input, for each key defined in
+        """ Using a dictionary as input, for each key defined in
         override_keys it will replace the config[key] entries with
         the key=value parameters provided """
 
@@ -272,7 +272,7 @@
                               img_sizes=self._tbm_img_sizes,
                               relative_paths=self._tbm_relative_paths))
         # When a seed pool is provided iterate through the entries
-        # and update platform spefific parameters
+        # and update platform specific parameters
         elif len(self._tbm_build_cfg):
             print("\r\n_tbm_build_cfg %s\r\n tbm_common_cfg %s\r\n" \
              % (self._tbm_build_cfg, self.tbm_common_cfg))
@@ -452,7 +452,7 @@
             return False
 
     def post_exec(self, eval_ret):
-        """ Generate a report and fail the script if build == unsuccessfull"""
+        """ Generate a report and fail the script if build == unsuccessful"""
 
         self.print_summary()
         if not eval_ret:
@@ -510,14 +510,14 @@
         abs_code_dir = os.path.abspath(os.path.expanduser(abs_code_dir))
         static_cfg["codebase_root_dir"] = abs_code_dir
 
-        # seed_params is an optional field. Do not proccess if it is missing
+        # seed_params is an optional field. Do not process if it is missing
         if "seed_params" in cfg:
             comb_cfg = cfg["seed_params"]
-            # Generate a list of all possible confugration combinations
+            # Generate a list of all possible configuration combinations
             ret_cfg = TFM_Build_Manager.generate_config_list(comb_cfg,
                                                              static_cfg)
 
-            # valid is an optional field. Do not proccess if it is missing
+            # valid is an optional field. Do not process if it is missing
             if "valid" in cfg:
                 # Valid configurations(Need to build)
                 valid_cfg = cfg["valid"]
@@ -527,7 +527,7 @@
                     static_cfg,
                     valid_cfg))
 
-            # invalid is an optional field. Do not proccess if it is missing
+            # invalid is an optional field. Do not process if it is missing
             if "invalid" in cfg:
                 # Invalid configurations(Do not build)
                 invalid_cfg = cfg["invalid"]
@@ -545,7 +545,7 @@
             self.simple_config = True
         return ret_cfg, static_cfg
 
-    # ----- Override bellow methods when subclassing for other projects ----- #
+    # ----- Override below methods when subclassing for other projects ----- #
 
     def print_summary(self):
         """ Print an comprehensive list of the build jobs with their status """
@@ -588,7 +588,7 @@
                   " Please check config" % static_config["config_type"])
 
         ret_cfg = {}
-        # Notify the user for the rejected configuations
+        # Notify the user for the rejected configurations
         for i in config_list:
             # Convert named tuples to string in a brief format
             config_param = []
@@ -626,7 +626,7 @@
                     if n in seed_config.keys()]
             sorted_default_lst = [seed_config[k] for k in tags]
 
-            # If tags are not alligned with optional list entries quit
+            # If tags are not aligned with optional list entries quit
             if len(tags) != len(optional_list[0]):
                 print(len(tags), len(optional_list[0]))
                 print("Error, tags should be assigned to each "
@@ -634,7 +634,7 @@
                 return []
 
             # Replace wildcard ( "*") entries with every
-            # inluded in cfg variant
+            # included in cfg variant
             for k in optional_list:
                 # Pad the omitted values with wildcard char *
                 res_list = list(k) + ["*"] * (5 - len(k))
@@ -653,7 +653,7 @@
                 # Append the configuration to the existing ones
                 optional_cfg = dict(optional_cfg, **op_cfg)
 
-            # Notify the user for the optional configuations
+            # Notify the user for the optional configurations
             for i in optional_cfg.keys():
                 print("Generating optional config %s" % i)
         else:
diff --git a/tfm_ci_pylib/tfm_builder.py b/tfm_ci_pylib/tfm_builder.py
index 9ca6c59..25ce850 100644
--- a/tfm_ci_pylib/tfm_builder.py
+++ b/tfm_ci_pylib/tfm_builder.py
@@ -31,15 +31,15 @@
     """ Wrap around tfm cmake system and spawn a thread to build the project.
     """
     def __init__(self,
-                 name,      # Proccess name
+                 name,      # Process name
                  work_dir,  # Current working directory(ie logs)
                  cfg_dict,  # Input config dictionary of the following form
                             # input_dict = {"PROJ_CONFIG": "ConfigRegression",
                             #               "TARGET_PLATFORM": "MUSCA_A",
                             #               "COMPILER": "ARMCLANG",
                             #               "CMAKE_BUILD_TYPE": "Debug"}
-                 build_threads=4,   # Number of CPU thrads used in build
-                 silent=False,      # Silence stdout ouptut
+                 build_threads=4,   # Number of CPU threads used in build
+                 silent=False,      # Silence stdout output
                  img_sizes=False,   # Use arm-none-eabi-size for size info
                  relative_paths=False):  # Store relative paths in report
 
@@ -186,7 +186,7 @@
     def task_exec(self):
         """ Main tasks """
 
-        # Mark proccess running as status
+        # Mark process running as status
         self.set_status(-1)
         print("builder _tfb_cfg %s" % self._tfb_cfg)
 
@@ -215,7 +215,7 @@
         rep = {"build_cmd": "%s" % ",".join(build_cmds)}
         self.stash("Build Report", rep)
 
-        # Calll cmake to configure the project
+        # Call cmake to configure the project
         for build_cmd in build_cmds:
             # if a -j parameter is passed as user argument
             user_set_threads_match = threads_no_rex.findall(build_cmd)
@@ -272,7 +272,7 @@
 
         rep["artefacts"] = artefacts
 
-        # Proccess the artifacts into file structures
+        # Process the artifacts into file structures
         art_files = {}
         for art_item in artefacts:
             art_f = {"pl_source": 1,
diff --git a/tfm_ci_pylib/utils.py b/tfm_ci_pylib/utils.py
index 3ef5a48..373b99f 100755
--- a/tfm_ci_pylib/utils.py
+++ b/tfm_ci_pylib/utils.py
@@ -57,7 +57,7 @@
 
 def print_test_dict(data_dict,
                     pad_space=80,
-                    identation=5,
+                    indentation=5,
                     titl="Summary",
                     pad_char="*"):
 
@@ -65,8 +65,8 @@
     {"TEST NAME": "RESULT"} used in CI systems. It will also return
     the string which is printing """
 
-    # Calculate pad space bewteen variables x, y t achieve alignment on y
-    # taking into consideration a maximum aligment boundary p and
+    # Calculate pad space between variables x, y t achieve alignment on y
+    # taking into consideration a maximum alignment boundary p and
     # possible indentation i
     def flex_pad(x, y, p, i):
         return " " * (p - i * 2 - len(x) - len(y)) + "-> "
@@ -75,15 +75,15 @@
     tests = [k + flex_pad(k,
                           v,
                           pad_space,
-                          identation) + v for k, v in data_dict.items()]
+                          indentation) + v for k, v in data_dict.items()]
 
-    # Add the identation
-    tests = map(lambda x: " " * identation + x, tests)
+    # Add the indentation
+    tests = map(lambda x: " " * indentation + x, tests)
 
     # Convert to string
     tests = "\n".join(tests)
 
-    # Calcuate the top header padding ceiling any rounding errors
+    # Calculate the top header padding ceiling any rounding errors
     hdr_pad = (pad_space - len(titl) - 3) / 2
 
     if detect_python3():
@@ -104,7 +104,7 @@
 
 
 def print_test(t_name=None, t_list=None, status="failed", tname="Tests"):
-    """ Print a list of tests in a stuctured ascii table format """
+    """ Print a list of tests in a structured ascii table format """
 
     gfx_line1 = "=" * 80
     gfx_line2 = "\t" + "-" * 70
@@ -127,9 +127,9 @@
          summary=True):
 
     """ Using input of a test_lst and a test results dictionary in the format
-    of test_name: resut key-value pairs, test() method will verify that Every
+    of test_name: result key-value pairs, test() method will verify that Every
     single method in the test_list has been tested and passed. Pass and Failed,
-    status tests can be overriden and error_on_failed flag, exits the script
+    status tests can be overridden and error_on_failed flag, exits the script
     with failure if a single test fails or is not detected. Returns a json
     containing status and fields for each test passed/failed/missing, if error
     on failed is not set.
@@ -146,14 +146,14 @@
     # Calculate the difference of the two sets to find missing tests
     t_report["missing"] = list(set(test_list) - set(test_dict.keys()))
 
-    # Sor the items into the apropriate lists (failed or passed)
+    # Sor the items into the appropriate lists (failed or passed)
     # based on their status.
     for k, v in test_dict.items():
         # print(k, v)
         key = "passed" if v in pass_text else "failed"
         t_report[key] += [k]
 
-    # For the test to pass every singe test in test_list needs to be present
+    # For the test to pass every single test in test_list needs to be present
     # and be in the passed list
     if len(test_list) == len(t_report["passed"]):
         t_report["success"] = True
@@ -195,7 +195,7 @@
 
 
 def sort_dict(config_dict, sort_order_list=None):
-    """ Create a fixed order disctionary out of a config dataset """
+    """ Create a fixed order dictionary out of a config dataset """
 
     if sort_order_list:
         ret = OrderedDict([(k, config_dict[k]) for k in sort_order_list])
@@ -232,7 +232,7 @@
 
 def subprocess_log(cmd, log_f, prefix=None, append=False, silent=False):
     """ Run a command as subproccess an log the output to stdout and fileself.
-    If prefix is spefified it will be added as the first line in file """
+    If prefix is specified it will be added as the first line in file """
 
     with open(log_f, 'a' if append else "w") as F:
         if prefix:
@@ -255,7 +255,7 @@
 
 def run_proccess(cmd):
     """ Run a command as subproccess an log the output to stdout and file.
-    If prefix is spefified it will be added as the first line in file """
+    If prefix is specified it will be added as the first line in file """
 
     pcss = Popen(cmd,
                  stdout=PIPE,
@@ -268,7 +268,7 @@
 
 def get_pid_status(pid):
     """ Read the procfc in Linux machines to determine a proccess's statusself.
-    Returns status if proccess exists or None if it does not """
+    Returns status if process exists or None if it does not """
 
     try:
         with open("/proc/%s/status" % pid, "r") as F:
@@ -281,7 +281,7 @@
 
 def check_pid_status(pid, status_list):
     """ Check a proccess's status againist a provided lists and return True
-    if the proccess exists and has a status included in the list. (Linux) """
+    if the process exists and has a status included in the list. (Linux) """
 
     pid_status = get_pid_status(pid)
 
@@ -316,7 +316,7 @@
 
 def gen_cfg_combinations(name, categories, *args):
     """ Create a list of named tuples of `name`, with elements defined in a
-    space separated string `categories` and equal ammount of lists for said
+    space separated string `categories` and equal amount of lists for said
     categories provided as arguments. Order of arguments should match the
     order of the categories lists """
 
@@ -346,7 +346,7 @@
 
 def arm_non_eabi_size(filename):
     """ Run arm-non-eabi-size command and parse the output using regex. Will
-    return a tuple with the formated data as well as the raw output of the
+    return a tuple with the formatted data as well as the raw output of the
     command """
 
     size_info_rex = re.compile(r'^\s+(?P<text>[0-9]+)\s+(?P<data>[0-9]+)\s+'
@@ -368,7 +368,7 @@
 
 def fromelf(filename):
     """ Run fromelf command and parse the output using regex. Will
-    return a tuple with the formated data as well as the raw output of the
+    return a tuple with the formatted data as well as the raw output of the
     command """
 
     size_info_rex = re.compile(r'^\s+(?P<Code>[0-9]+)\s+(?P<data>[0-9]+)\s+'
@@ -476,7 +476,7 @@
 
     remote = proc_res[2]
     # Internal Gerrit specific code
-    # Intended for converting the git remote to a more usuable url
+    # Intended for converting the git remote to a more usable url
     known_remotes = ["https://gerrit.oss.arm.com",
                      "http://gerrit.mirror.oss.arm.com"]