parameters: (diff_file, ent_path)
docstring: Run the main function.
docstring_summary: Run the main function.
docstring_tokens: Run the main function .
function: def main(diff_file, ent_path):
      """Run the main function."""
      with open("base_all_feature_flags.txt", "r") as fh:
          base_feature_flags = fh.read().split()
      with open("patch_all_feature_flags.txt", "r") as fh:
          patch_feature_flags = fh.read().split()
      enabled_feature_flags = [flag for flag in base_feature_flags if flag not in patch_feature_flags]
  
      if not enabled_feature_flags:
          print(
              "No feature flags were enabled by default in this patch/commit; skipping feature flag checks"
          )
          sys.exit(0)
  
      tests_with_feature_flag_tag = get_tests_with_feature_flag_tags(enabled_feature_flags, ent_path)
  
      _run_git_cmd(["apply", diff_file])
      _run_git_cmd(["apply", diff_file], cwd=ent_path)
      tests_missing_fcv_tag = get_tests_missing_fcv_tag(tests_with_feature_flag_tag)
  
      if tests_missing_fcv_tag:
          print(f"Found tests missing `{REQUIRES_FCV_TAG_LATEST}` tag:\n" +
                "\n".join(tests_missing_fcv_tag))
          sys.exit(1)
      sys.exit(0)
function_tokens: def main ( diff_file , ent_path ) : with open ( "base_all_feature_flags.txt" , "r" ) as fh : base_feature_flags = fh . read ( ) . split ( ) with open ( "patch_all_feature_flags.txt" , "r" ) as fh : patch_feature_flags = fh . read ( ) . split ( ) enabled_feature_flags = [ flag for flag in base_feature_flags if flag not in patch_feature_flags ] if not enabled_feature_flags : print ( "No feature flags were enabled by default in this patch/commit; skipping feature flag checks" ) sys . exit ( 0 ) tests_with_feature_flag_tag = get_tests_with_feature_flag_tags ( enabled_feature_flags , ent_path ) _run_git_cmd ( [ "apply" , diff_file ] ) _run_git_cmd ( [ "apply" , diff_file ] , cwd = ent_path ) tests_missing_fcv_tag = get_tests_missing_fcv_tag ( tests_with_feature_flag_tag ) if tests_missing_fcv_tag : print ( f"Found tests missing `{REQUIRES_FCV_TAG_LATEST}` tag:\n" + "\n" . join ( tests_missing_fcv_tag ) ) sys . exit ( 1 ) sys . exit ( 0 )