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

Replace indentation of source before parsing with ast. #5691

Merged

Conversation

Godson-Gnanaraj
Copy link
Contributor

@Godson-Gnanaraj Godson-Gnanaraj commented Oct 25, 2022

closes #5323

Replace starting indentation with pattern (^[\t ]+) and replace the matching indentation in other lines.

Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

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

Could you add a test for this?

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #5691 (b0ddffc) into master (b33244e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5691      +/-   ##
==========================================
+ Coverage   88.64%   88.66%   +0.02%     
==========================================
  Files         162      162              
  Lines       10986    10995       +9     
  Branches     1798     1799       +1     
==========================================
+ Hits         9738     9749      +11     
+ Misses        967      966       -1     
+ Partials      281      280       -1     
Impacted Files Coverage Δ
scrapy/utils/misc.py 97.81% <100.00%> (+0.08%) ⬆️
scrapy/pipelines/images.py 94.95% <0.00%> (+0.17%) ⬆️
scrapy/core/downloader/__init__.py 92.48% <0.00%> (+1.50%) ⬆️

Copy link
Member

@elacuesta elacuesta left a comment

Choose a reason for hiding this comment

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

Looking good, just a few suggestions. Thanks!

scrapy/utils/misc.py Outdated Show resolved Hide resolved
scrapy/utils/misc.py Outdated Show resolved Hide resolved
scrapy/utils/misc.py Outdated Show resolved Hide resolved
  - compile regex
  - readability improvements
@wRAR wRAR merged commit 92be5ba into scrapy:master Oct 26, 2022
@kmike kmike added this to the Scrapy 2.7.1 milestone Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants