mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] *: remove invalid escape sequences
This commit is contained in:
parent
e7d1cc9c57
commit
2a18cd7f3d
@ -58,7 +58,7 @@ class Project(models.Model):
|
||||
return super()._find_commands(comment)
|
||||
|
||||
return re.findall(
|
||||
'^\s*[@|#]?{}:? (.*)$'.format(self.fp_github_name),
|
||||
r'^\s*[@|#]?{}:? (.*)$'.format(self.fp_github_name),
|
||||
comment, re.MULTILINE | re.IGNORECASE
|
||||
) + super()._find_commands(comment)
|
||||
|
||||
@ -358,7 +358,7 @@ class PullRequests(models.Model):
|
||||
|
||||
tokens = [
|
||||
token
|
||||
for line in re.findall('^\s*[@|#]?{}:? (.*)$'.format(self.repository.project_id.fp_github_name), comment['body'] or '', re.MULTILINE | re.IGNORECASE)
|
||||
for line in re.findall(r'^\s*[@|#]?{}:? (.*)$'.format(self.repository.project_id.fp_github_name), comment['body'] or '', re.MULTILINE | re.IGNORECASE)
|
||||
for token in line.split()
|
||||
]
|
||||
if not tokens:
|
||||
|
@ -403,7 +403,7 @@ conflict in this pull request, data may have been lost.
|
||||
|
||||
stdout:
|
||||
```.*?
|
||||
CONFLICT \(add/add\): Merge conflict in h.*?
|
||||
CONFLICT \\(add/add\\): Merge conflict in h.*?
|
||||
```
|
||||
|
||||
stderr:
|
||||
|
@ -1244,4 +1244,4 @@ class BuildResult(models.Model):
|
||||
commit._github_status(build, trigger.ci_context, state, target_url, desc)
|
||||
|
||||
def _parse_config(self):
|
||||
return set(findall(self._server("tools/config.py"), '--[\w-]+', ))
|
||||
return set(findall(self._server("tools/config.py"), r'--[\w-]+', ))
|
||||
|
@ -52,7 +52,7 @@ class TestBuildError(RunbotCase):
|
||||
def test_create_write_clean(self):
|
||||
|
||||
self.ErrorRegex.create({
|
||||
'regex': '\d+',
|
||||
'regex': r'\d+',
|
||||
're_type': 'cleaning',
|
||||
})
|
||||
|
||||
|
@ -414,7 +414,7 @@ class TestIdentityFile(RunbotCase):
|
||||
def check_output_helper(self):
|
||||
"""Helper that returns a mock for repo._git()"""
|
||||
def mock_check_output(cmd, *args, **kwargs):
|
||||
expected_option = '-c core.sshCommand=ssh -i \/.+\/\.ssh\/fake_identity'
|
||||
expected_option = r'-c core.sshCommand=ssh -i \/.+\/\.ssh\/fake_identity'
|
||||
git_cmd = ' '.join(cmd)
|
||||
self.assertTrue(re.search(expected_option, git_cmd), '%s did not match %s' % (git_cmd, expected_option))
|
||||
return Mock()
|
||||
|
@ -30,7 +30,7 @@ class Step(models.Model):
|
||||
mo = re.search('[^ <@]+@[^ @>]+', email or '')
|
||||
if mo:
|
||||
email = mo.group(0).lower()
|
||||
if not re.match('.*@(odoo|openerp|tinyerp)\.com$', email):
|
||||
if not re.match(r'.*@(odoo|openerp|tinyerp)\.com$', email):
|
||||
try:
|
||||
cla = ''.join(io.open(f, encoding='utf-8').read() for f in cla_glob)
|
||||
if cla.lower().find(email) == -1:
|
||||
|
@ -74,7 +74,7 @@ class Project(models.Model):
|
||||
|
||||
def _find_commands(self, comment):
|
||||
return re.findall(
|
||||
'^\s*[@|#]?{}:? (.*)$'.format(self.github_prefix),
|
||||
r'^\s*[@|#]?{}:? (.*)$'.format(self.github_prefix),
|
||||
comment, re.MULTILINE | re.IGNORECASE)
|
||||
|
||||
def _has_branch(self, name):
|
||||
|
@ -624,7 +624,7 @@ def test_ff_failure(env, repo, config, page):
|
||||
_new, prev = doc.cssselect('li.staging')
|
||||
|
||||
assert 'bg-gray-lighter' in prev.classes, "ff failure is ~ cancelling"
|
||||
assert prev.get('title') == re_matches('fast forward failed \(update is not a fast forward\)')
|
||||
assert prev.get('title') == re_matches(r'fast forward failed \(update is not a fast forward\)')
|
||||
|
||||
assert env['runbot_merge.pull_requests'].search([
|
||||
('repository.name', '=', repo.name),
|
||||
|
Loading…
Reference in New Issue
Block a user