Skip to content

Commit

Permalink
ignore E501 line too long
Browse files Browse the repository at this point in the history
  • Loading branch information
absszero committed Feb 21, 2024
1 parent 39008af commit 45272d4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-ignore = E501
exclude = .git,__pycache__,.github
2 changes: 1 addition & 1 deletion lib/blade.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def get_place(self, path, line, lines=''):
blade_patterns = [
compile(r"""[\bview\b|\bmarkdown\b]\(\s*(['"])([^'"]*)\1"""),
compile(r"""\$view\s*=\s*(['"])([^'"]*)\1"""),
compile(r"""[\bview\b|\btext\b|\bhtml\b|\bmarkdown\b]\s*:\s*(['"])([^'"]*)\1"""), # noqa: E501
compile(r"""[\bview\b|\btext\b|\bhtml\b|\bmarkdown\b]\s*:\s*(['"])([^'"]*)\1"""),
compile(r"""view\(\s*['"][^'"]*['"],\s*(['"])([^'"]*)\1"""),
compile(r"""[lL]ayout\(\s*(['"])([^'"]*)\1"""),
compile(r"""['"]layout['"]\s*=>\s*(['"])([^'"]*)\1"""),
Expand Down
2 changes: 1 addition & 1 deletion lib/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def path_helper_place(path, line, lines, selected):
def middleware_place(path, line, lines, selected):
middleware_patterns = [
compile(r"""[m|M]iddleware\(\s*\[?\s*(['"][^'"]+['"]\s*,?\s*)+"""),
compile(r"""['"]middleware['"]\s*=>\s*\s*\[?\s*(['"][^'"]+['"]\s*,?\s*){1,}\]?"""), # noqa: E501
compile(r"""['"]middleware['"]\s*=>\s*\s*\[?\s*(['"][^'"]+['"]\s*,?\s*){1,}\]?"""),
]
middlewares = None
for pattern in middleware_patterns:
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def all(self):

# Before Laravel 10, middlewareAliases was called routeMiddleware.
# They work the exact same way.
aliasPattern = r"""(\$\bmiddlewareAliases\b|\$\brouteMiddleware\b)\s*=\s*\[([^;]+)""" # noqa: E501
aliasPattern = r"""(\$\bmiddlewareAliases\b|\$\brouteMiddleware\b)\s*=\s*\[([^;]+)"""

match = re.search(aliasPattern, self.http_kernel, re.M)
if match is None:
Expand Down
2 changes: 1 addition & 1 deletion lib/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

patterns = [
(compile(r"""(controller)\s*\(\s*['"]?([^'")]+)"""), False),
(compile(r"""resource\s*\(\s*['"][^'"]+['"]\s*,\s*(['"]?)([^,'"]+)"""), False), # noqa: E501
(compile(r"""resource\s*\(\s*['"][^'"]+['"]\s*,\s*(['"]?)([^,'"]+)"""), False),
(compile(r"""namespace\s*\(\s*(['"])\s*([^'"]+)\1"""), True),
(compile(r"""['"]namespace['"]\s*=>\s*(['"])([^'"]+)\1"""), True),
]
Expand Down
2 changes: 1 addition & 1 deletion lib/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_selection(self):
return selected
return self.get_selected_by_delimiters(selected, self.delimiters)

def get_selected_by_delimiters(self, selected, start_delims, end_delims=None): # noqa: E501
def get_selected_by_delimiters(self, selected, start_delims, end_delims=None):
start = selected.begin()
end = selected.end()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_all(
m_get_path.return_value = 'artisan'
m_is_changed.return_value = True
m_set_unchanged.return_value = None
m_check_output.return_value = bytes('[{"name":"admin.index","action":"App\\\\Http\\\\Controllers\\\\AdminController@index","middleware":[]},{"name":null,"action":"Closure","middleware":[]},{"name":null,"action":"Closure","middleware":[]}]', 'utf-8') # noqa: E501
m_check_output.return_value = bytes('[{"name":"admin.index","action":"App\\\\Http\\\\Controllers\\\\AdminController@index","middleware":[]},{"name":null,"action":"Closure","middleware":[]},{"name":null,"action":"Closure","middleware":[]}]', 'utf-8')

router = Router()
router.update()
Expand Down

0 comments on commit 45272d4

Please sign in to comment.