Functions | Variables
check_redundant_namespace_qualifiers Namespace Reference

Functions

def find_closing_mustache (contents, initial_depth)
 
def is_a_define_statement (match, body)
 
def update_file (contents, namespaces)
 

Variables

tuple _CONFIGURATION = (Config(['src/core', 'test/core'], ['grpc_core']),)
 
string _TEST
 
string _TEST_EXPECTED
 
list changed = []
 
 Config = collections.namedtuple('Config', ['dirs', 'namespaces'])
 
 contents = f.read()
 
def output = update_file(_TEST, ['foo'])
 
 path = os.path.join(root, file)
 
def updated = update_file(contents, config.namespaces)
 

Function Documentation

◆ find_closing_mustache()

def check_redundant_namespace_qualifiers.find_closing_mustache (   contents,
  initial_depth 
)
Find the closing mustache for a given number of open mustaches.

Definition at line 25 of file check_redundant_namespace_qualifiers.py.

◆ is_a_define_statement()

def check_redundant_namespace_qualifiers.is_a_define_statement (   match,
  body 
)
See if the matching line begins with #define

Definition at line 65 of file check_redundant_namespace_qualifiers.py.

◆ update_file()

def check_redundant_namespace_qualifiers.update_file (   contents,
  namespaces 
)
Scan the contents of a file, and for top-level namespaces in namespaces remove redundant usages.

Definition at line 73 of file check_redundant_namespace_qualifiers.py.

Variable Documentation

◆ _CONFIGURATION

tuple check_redundant_namespace_qualifiers._CONFIGURATION = (Config(['src/core', 'test/core'], ['grpc_core']),)
private

Definition at line 144 of file check_redundant_namespace_qualifiers.py.

◆ _TEST

string check_redundant_namespace_qualifiers._TEST
private
Initial value:
1 = """
2 namespace bar {
3  namespace baz {
4  }
5 }
6 namespace foo {}
7 namespace foo {
8  foo::a;
9 }
10 """

Definition at line 113 of file check_redundant_namespace_qualifiers.py.

◆ _TEST_EXPECTED

string check_redundant_namespace_qualifiers._TEST_EXPECTED
private
Initial value:
1 = """
2 namespace bar {
3  namespace baz {
4  }
5 }
6 namespace foo {}
7 namespace foo {
8  a;
9 }
10 """

Definition at line 123 of file check_redundant_namespace_qualifiers.py.

◆ changed

list check_redundant_namespace_qualifiers.changed = []

Definition at line 146 of file check_redundant_namespace_qualifiers.py.

◆ Config

check_redundant_namespace_qualifiers.Config = collections.namedtuple('Config', ['dirs', 'namespaces'])

Definition at line 142 of file check_redundant_namespace_qualifiers.py.

◆ contents

check_redundant_namespace_qualifiers.contents = f.read()

Definition at line 156 of file check_redundant_namespace_qualifiers.py.

◆ output

def check_redundant_namespace_qualifiers.output = update_file(_TEST, ['foo'])

Definition at line 133 of file check_redundant_namespace_qualifiers.py.

◆ path

check_redundant_namespace_qualifiers.path = os.path.join(root, file)

Definition at line 153 of file check_redundant_namespace_qualifiers.py.

◆ updated

def check_redundant_namespace_qualifiers.updated = update_file(contents, config.namespaces)

Definition at line 159 of file check_redundant_namespace_qualifiers.py.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:01