File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1111from search_query .utils import format_query_string_pos
1212
1313
14- def run_linter (search_string : str , syntax : str ) -> list :
14+ def run_linter (search_string : str , platform : str ) -> list :
1515 """Run the linter on the search string"""
1616
17- parser = search_query .parser .PARSERS [syntax ](search_string )
17+ parser = search_query .parser .PARSERS [platform ](search_string )
1818 try :
1919 parser .parse ()
2020 except Exception : # pylint: disable=broad-except
@@ -34,7 +34,14 @@ def pre_commit_hook() -> int:
3434 print (e )
3535 return ExitCodes .FAIL
3636
37- linter_messages = run_linter (search_file .search_string , search_file .search_string )
37+ if platform not in search_query .parser .PARSERS :
38+ print (
39+ f"Unknown platform: { platform } ."
40+ f"Must be one of { search_query .parser .PARSERS } "
41+ )
42+ return ExitCodes .FAIL
43+
44+ linter_messages = run_linter (search_file .search_string , platform )
3845
3946 if linter_messages :
4047 for message in linter_messages :
You can’t perform that action at this time.
0 commit comments