Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear out Python syntax warnings #8229

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: clear out Python syntax warnings
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6e8ba49
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b9fee10
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f4f25b6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5506b7d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6a10d2d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 3d1af4b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 00a5acd
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 06103dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 58ecb3a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 58ecb3a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a7c2051
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a7c2051
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 8eef6ac
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 8eef6ac
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916971
version: 1

Invalid escape sequences are used, and produced syntax warnings:

```
$ test_bpftool_synctypes.py
test_bpftool_synctypes.py:69: SyntaxWarning: invalid escape sequence '\['
  self.start_marker = re.compile(f'(static )?const bool {self.array_name}\[.*\] = {{\n')
test_bpftool_synctypes.py:83: SyntaxWarning: invalid escape sequence '\['
  pattern = re.compile('\[(BPF_\w*)\]\s*= (true|false),?$')
test_bpftool_synctypes.py:181: SyntaxWarning: invalid escape sequence '\s'
  pattern = re.compile('^\s*(BPF_\w+),?(\s+/\*.*\*/)?$')
test_bpftool_synctypes.py:229: SyntaxWarning: invalid escape sequence '\*'
  start_marker = re.compile(f'\*{block_name}\* := {{')
test_bpftool_synctypes.py:229: SyntaxWarning: invalid escape sequence '\*'
  start_marker = re.compile(f'\*{block_name}\* := {{')
test_bpftool_synctypes.py:230: SyntaxWarning: invalid escape sequence '\*'
  pattern = re.compile('\*\*([\w/-]+)\*\*')
test_bpftool_synctypes.py:248: SyntaxWarning: invalid escape sequence '\s'
  start_marker = re.compile(f'"\s*{block_name} := {{')
test_bpftool_synctypes.py:249: SyntaxWarning: invalid escape sequence '\w'
  pattern = re.compile('([\w/]+) [|}]')
test_bpftool_synctypes.py:267: SyntaxWarning: invalid escape sequence '\s'
  start_marker = re.compile(f'"\s*{macro}\s*" [|}}]')
test_bpftool_synctypes.py:267: SyntaxWarning: invalid escape sequence '\s'
  start_marker = re.compile(f'"\s*{macro}\s*" [|}}]')
test_bpftool_synctypes.py:268: SyntaxWarning: invalid escape sequence '\w'
  pattern = re.compile('([\w-]+) ?(?:\||}[ }\]])')
test_bpftool_synctypes.py:287: SyntaxWarning: invalid escape sequence '\w'
  pattern = re.compile('(?:.*=\')?([\w/]+)')
test_bpftool_synctypes.py:319: SyntaxWarning: invalid escape sequence '\w'
  pattern = re.compile('([\w-]+) ?(?:\||}[ }\]"])')
test_bpftool_synctypes.py:341: SyntaxWarning: invalid escape sequence '\|'
  start_marker = re.compile('\|COMMON_OPTIONS\| replace:: {')
test_bpftool_synctypes.py:342: SyntaxWarning: invalid escape sequence '\*'
  pattern = re.compile('\*\*([\w/-]+)\*\*')
```

Escaping them clears out the warnings.

```
$ tools/testing/selftests/bpf/test_bpftool_synctypes.py; echo $?
0
```

Link: https://docs.python.org/fr/3/library/re.html
CC: Alexei Starovoitov <[email protected]>
CC: Daniel Borkmann <[email protected]>
CC: Andrii Nakryiko <[email protected]>
CC: Shuah Khan <[email protected]>
Signed-off-by: Ariel Otilibili <[email protected]>
Tested-by: Quentin Monnet <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=916971 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/916971=>bpf-next branch December 20, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants