Skip to content

Commit eb432b6

Browse files
committed
move prefix_path arg to CppPathIncFilter
1 parent e931974 commit eb432b6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

elixir/filters/cpppathinc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
from typing import List
23
from .utils import Filter, FilterContext, encode_number, decode_number, extension_matches
34

45
# Filters for cpp includes like these:
@@ -9,7 +10,8 @@
910
# end up with links to headers which are outside the project
1011
# Example: u-boot/v2023.10/source/env/embedded.c#L16
1112
class CppPathIncFilter(Filter):
12-
def __init__(self, *args, **kwargs):
13+
def __init__(self, prefix_path: List[str] = ["include"], *args, **kwargs):
14+
self.prefix_path = prefix_path
1315
super().__init__(*args, **kwargs)
1416
self.cpppathinc = []
1517

elixir/filters/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ class FilterContext:
3030
# path_exceptions: list of regexes, disables filter if path of the filtered file matches a regex from the list
3131
# prefix_path: a list of paths, will be used to replace the prefix path during the untransform_formatted_code step
3232
class Filter:
33-
def __init__(self, path_exceptions: List[str] = [], prefix_path: List[str] = ["include"]):
33+
def __init__(self, path_exceptions: List[str] = []):
3434
self.path_exceptions = path_exceptions
35-
self.prefix_path = prefix_path
3635

3736
# Return True if filter can be applied to file with path
3837
def check_if_applies(self, ctx: FilterContext) -> bool:

0 commit comments

Comments
 (0)