Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jostrzol committed Dec 29, 2024
1 parent d896fb8 commit 8f3742c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lizard_languages/clike.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _state_dec(self, token):
else:
self.next(self._state_global)
elif len(self.bracket_stack) == 1:
if token != 'void': # void is a reserved keyword, meaning no parameters
if token != 'void': # void is a reserved keyword, meaning no parameters
self.context.parameter(token)
return
self.context.add_to_long_function_name(token)
Expand Down
5 changes: 4 additions & 1 deletion lizard_languages/fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import re
from .code_reader import CodeStateMachine, CodeReader


class FortranCommentsMixin:
@staticmethod
def get_comment_from_token(token):
if token.startswith('!'):
return token[1:]


class FortranReader(CodeReader, FortranCommentsMixin):
'''This is the reader for Fortran.'''

Expand Down Expand Up @@ -76,6 +78,7 @@ def preprocess(self, tokens):
elif not token.isspace() or token == '\n':
yield token


class FortranStates(CodeStateMachine):
_ends = re.compile('|'.join(r'END\s*{0}'.format(_) for _ in FortranReader._blocks), re.I)

Expand Down Expand Up @@ -255,4 +258,4 @@ def _module_or_procedure(self, token):
self._state = self._procedure
else:
self._state = self._module
self._module(token)
self._module(token)
2 changes: 1 addition & 1 deletion lizard_languages/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, context):
self.indents = [0]
self.context = context

def set_nesting(self, spaces, token = ""):
def set_nesting(self, spaces, token=""):
while self.indents[-1] > spaces and (not token.startswith(")")):
self.indents.pop()
self.context.pop_nesting()
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ docstring-min-length=-1
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=80
max-line-length=120

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ universal = 1

[tool:pytest]
python_files = test*

[pycodestyle]
max-line-length = 120

0 comments on commit 8f3742c

Please sign in to comment.