src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/pycodestyle.py

branch
eric7
changeset 10995
f94a27bbf6c4
parent 10882
4e6556be3907
child 11090
f5f5f5803935
equal deleted inserted replaced
10994:e37149c2e4f9 10995:f94a27bbf6c4
82 sys.version_info < (3, 10) and 82 sys.version_info < (3, 10) and
83 callable(getattr(tokenize, '_compile', None)) 83 callable(getattr(tokenize, '_compile', None))
84 ): # pragma: no cover (<py310) 84 ): # pragma: no cover (<py310)
85 tokenize._compile = lru_cache(tokenize._compile) # type: ignore 85 tokenize._compile = lru_cache(tokenize._compile) # type: ignore
86 86
87 __version__ = '2.12.0-eric' 87 __version__ = '2.12.1-eric'
88 88
89 DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox' 89 DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox'
90 DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704,W503,W504' 90 DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704,W503,W504'
91 try: 91 try:
92 if sys.platform == 'win32': # pragma: win32 cover 92 if sys.platform == 'win32': # pragma: win32 cover
1979 comments.append(text) 1979 comments.append(text)
1980 continue 1980 continue
1981 if token_type == tokenize.STRING: 1981 if token_type == tokenize.STRING:
1982 text = mute_string(text) 1982 text = mute_string(text)
1983 elif token_type == FSTRING_MIDDLE: # pragma: >=3.12 cover 1983 elif token_type == FSTRING_MIDDLE: # pragma: >=3.12 cover
1984 text = 'x' * len(text) 1984 # fstring tokens are "unescaped" braces -- re-escape!
1985 brace_count = text.count('{') + text.count('}')
1986 text = 'x' * (len(text) + brace_count)
1987 end = (end[0], end[1] + brace_count)
1985 if prev_row: 1988 if prev_row:
1986 (start_row, start_col) = start 1989 (start_row, start_col) = start
1987 if prev_row != start_row: # different row 1990 if prev_row != start_row: # different row
1988 prev_text = self.lines[prev_row - 1][prev_col - 1] 1991 prev_text = self.lines[prev_row - 1][prev_col - 1]
1989 if prev_text == ',' or (prev_text not in '{[(' and 1992 if prev_text == ',' or (prev_text not in '{[(' and

eric ide

mercurial