Skip to content

Commit

Permalink
Merge pull request #102 from citation-file-format/updated-regexps
Browse files Browse the repository at this point in the history
Updated regexps
  • Loading branch information
jspaaks authored Oct 1, 2019
2 parents 90a406e + 721014c commit a24820d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cffconvert/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def _remove_suspect_keys(self):
self.cffstr = yaml.safe_dump(self.yaml, default_flow_style=False)

def _retrieve_file(self):
regexp = re.compile("^" +
"(?P<baseurl>https://github\.com)/" +
regexp = re.compile(r"^" +
"(?P<baseurl>https://github.com)/" +
"(?P<org>[^/\n]*)/" +
"(?P<repo>[^/\n]*)" +
"(/tree/(?P<label>[^/\n]*))?", re.IGNORECASE)
Expand All @@ -122,7 +122,7 @@ def _retrieve_file(self):
raise Exception("Error requesting file: {0}".format(self.file_url))

def _validate(self):
regexp = re.compile("^cff-version: (['|\"])?(?P<semver>[\d\.]*)(['\"])?\s*$")
regexp = re.compile(r"^cff-version: (['|\"])?(?P<semver>[\d\.]*)(['\"])?\s*$")
semver = None
for line in self.cffstr.split("\n"):
matched = re.match(regexp, line)
Expand Down
2 changes: 1 addition & 1 deletion livetest/citation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_retrieval_via_sha(self):
self.assertEqual(expected_cffstr, actual_cffstr)


class CitationTestUrlHasOrgRepoOrgRepoTreeTag(unittest.TestCase):
class CitationTestUrlHasOrgRepoTreeTag(unittest.TestCase):

def test_retrieval_via_tag(self):
# https://github.com/<org>/<repo>/tree/<tagname>
Expand Down

0 comments on commit a24820d

Please sign in to comment.