コード例 #1
0
def name_is_jsignored(name, node):
    result = []
    for hint in jshints.find_hints_upward(node):
        for cat in (('ignore', None), ('lint', 'ignoreUndefined')):
            if hint.ident_matches(name, cat):
                result.append(cat)
    return result
コード例 #2
0
ファイル: global_symbols.py プロジェクト: peuter/qooxdoo
def name_is_jsignored(name, node):
    result = []
    for hint in jshints.find_hints_upward(node):
        for cat in (("ignore", None), ("lint", "ignoreUndefined")):
            if hint.ident_matches(name, cat):
                result.append(cat)
    return result
コード例 #3
0
def ident_is_ignored(name, node):
    result = []
    for hint in jshints.find_hints_upward(node):
        for cat in (('ignore',None), ('lint','ignoreUndefined')):
            if hint.ident_matches(name, cat):
                result.append(cat)
    return result
コード例 #4
0
ファイル: lint.py プロジェクト: choubayu/qooxdoo
def get_at_hints(node):
    at_hints = defaultdict(dict)
    for hint in jshints.find_hints_upward(node):
        for cat in hint.hints:
            entry = hint.hints[cat]
            if cat=='lint':
                for functor in entry:
                    if functor not in at_hints[cat]:
                        at_hints[cat][functor] = set()
                    # TODO: consumers are not yet prepared to handle HintArgument()s
                    # use the next to raise a helpful exception
                    # at_hints[cat][functor].update(entry[functor])
                    s = set([x.source for x in entry[functor]])
                    at_hints[cat][functor].update(s)
            elif cat=="ignore":
                if cat not in at_hints:
                    at_hints[cat] = set()
                # dito, s.above
                s = set([x.source for x in entry[None]])
                at_hints[cat].update(s)

    return at_hints
コード例 #5
0
def get_at_hints(node):
    at_hints = defaultdict(dict)
    for hint in jshints.find_hints_upward(node):
        for cat in hint.hints:
            entry = hint.hints[cat]
            if cat=='lint':
                for functor in entry:
                    if functor not in at_hints[cat]:
                        at_hints[cat][functor] = set()
                    # TODO: consumers are not yet prepared to handle HintArgument()s
                    # use the next to raise a helpful exception
                    # at_hints[cat][functor].update(entry[functor]) 
                    s = set([x.source for x in entry[functor]])
                    at_hints[cat][functor].update(s)
            elif cat=="ignore":
                if cat not in at_hints:
                    at_hints[cat] = set()
                # dito, s.above
                s = set([x.source for x in entry[None]])
                at_hints[cat].update(s)
        
    return at_hints