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

Full typing for scrapy/contracts. #6371

Merged
merged 1 commit into from
May 30, 2024
Merged

Conversation

wRAR
Copy link
Member

@wRAR wRAR commented May 19, 2024

No description provided.

Copy link

codecov bot commented May 19, 2024

Codecov Report

Attention: Patch coverage is 95.55556% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 88.98%. Comparing base (180bc9b) to head (b99526b).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6371      +/-   ##
==========================================
+ Coverage   85.00%   88.98%   +3.97%     
==========================================
  Files         161      162       +1     
  Lines       11962    12115     +153     
  Branches     1872     1725     -147     
==========================================
+ Hits        10168    10780     +612     
+ Misses       1512     1016     -496     
- Partials      282      319      +37     
Files Coverage Δ
scrapy/contracts/default.py 88.67% <100.00%> (+0.21%) ⬆️
scrapy/contracts/__init__.py 82.75% <94.28%> (+0.53%) ⬆️

... and 40 files with indirect coverage changes

for line in method.__doc__.split("\n"):
line = line.strip()

if line.startswith("@"):
name, args = re.match(r"@(\w+)\s*(.*)", line).groups()
m = re.match(r"@(\w+)\s*(.*)", line)
assert m is not None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be None, though. Should we open a ticket to update it, e.g. to raise an exception about an invalid contract line being found?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wRAR @Gallaecio Should we raise an exception or just pass the unmatched regex using continue ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in #6383, "I think we should just skip lines that don't match."

@wRAR wRAR merged commit a011fa6 into scrapy:master May 30, 2024
27 checks passed
@wRAR wRAR deleted the typing-contracts branch May 30, 2024 16:59
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.

None yet

3 participants