-
Notifications
You must be signed in to change notification settings - Fork 27
clean warnings. Package build as url instead of string, readthedocs, Fixes #855, Fixes #864, Fixes #865, Fixes #866, #873
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
Conversation
| REGEXP_READTHEDOCS_HTML = ( | ||
| r"<a\b[^>]+?href=['\"](https?://[^'\"\s]+?)['\"][^>]*?>" | ||
| r"(?:(?!</a>)[\s\S])*?" | ||
| r"<img\b[^>]+?src=['\"]https?://(?:readthedocs\.org/projects/|img\.shields\.io/pypi/)[^'\"\s]*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regular expression is potentially dangerous, and it may be slow.
Try this one instead:
r"""
<a\b
[^>]*\bhref=['"](https?://[^'"\s]+)['"]
[^>]*>
(?:
[^<]+
|
<(?!/a\b)[^>]*>
)*
<img\b
[^>]*\bsrc=['"]
https?://(?:readthedocs\.org/projects/|img\.shields\.io/pypi/)
[^'"\s>]+
['"]
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll try again after all test pass
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "DESCRIPTION") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "DESCRIPTION") | ||
| self.assertEqual(package_results[0]["result"]["value"], "https://example.org/DESCRIPTION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this looking into example.org?
If somef is run locally and there is no repo, it should return the path to the file...
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "bootstrap-datepicker-rails.gemspec") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "bootstrap-datepicker-rails.gemspec") | ||
| self.assertEqual(package_results[0]["result"]["value"], "https://example.org/bootstrap-datepicker-rails.gemspec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| self.assertTrue(len(package_results) > 0, "No package file info found") | ||
| self.assertEqual(package_results[0]["result"]["value"], "package.json") | ||
| # self.assertEqual(package_results[0]["result"]["value"], "package.json") | ||
| self.assertEqual(package_results[0]["result"]["value"], "http://example.com/package_neors.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| parse_toml_file(self.cargo_toml_path, result, "test") | ||
| # parse_toml_file(self.cargo_toml_path, result, "test") | ||
| print("self.cargo_toml_path:", self.cargo_toml_path) | ||
| parse_toml_file(self.cargo_toml_path, result, "http://example.com/rustdesk/Cargo.toml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
better readthedocs badges.