Skip to content

Change tabs to spaces, prepare for black#42

Closed
emirkmo wants to merge 8 commits intoSNflows:develfrom
emirkmo:prepare_for_black
Closed

Change tabs to spaces, prepare for black#42
emirkmo wants to merge 8 commits intoSNflows:develfrom
emirkmo:prepare_for_black

Conversation

@emirkmo
Copy link
Contributor

@emirkmo emirkmo commented Feb 14, 2022

This PR changes tab indent to 4 spaces in the entire project, to prepare setting up for python black for automatic code formatting.

It also auto applies some common auto-fixable PEP8 stuff (I applied it while doing the indent changes, because why not, we strive to follow PEP8). We also change the setup.cfg for flake8 to be compatible with black and to remove tabs. Good to know that black has its own GitHub actions. So we should set up black and never worry about code formatting again for flows.
(Bonus, we can set up pre-commit hooks on e.g. GitKraken with black.

Specific changes:
Change line limit to 120 characters in setup.cfg but exact number can be discussed. Black default is 88. Project default was 99. We did not enforce it before. We should just pick something that makes it easy to read and set Black to that.

We move to a 4 space indent format.

This PR should be merged before #40 so that GitHub Actions tests can pass.

Fixes #44

We move to a 4 space format, Automatically fix Pep8 mistakes that can be auto fixed, and change the Flake8 setup.cfg to match what will happen under black. Currently line limit is set at 120 but that can be discussed.
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #42 (42ef171) into devel (3305323) will decrease coverage by 0.19%.
The diff coverage is 22.67%.

❗ Current head 42ef171 differs from pull request most recent head 32fbb4a. Consider uploading reports for the commit 32fbb4a to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##            devel      #42      +/-   ##
==========================================
- Coverage   29.15%   28.96%   -0.20%     
==========================================
  Files          36       36              
  Lines        2627     2627              
==========================================
- Hits          766      761       -5     
- Misses       1861     1866       +5     
Impacted Files Coverage Δ
flows/aadc_db.py 100.00% <ø> (ø)
run_catalogs.py 0.00% <ø> (ø)
run_photometry.py 0.00% <0.00%> (ø)
run_plotlc.py 0.00% <0.00%> (ø)
run_querytns.py 0.00% <0.00%> (ø)
run_upload_photometry.py 0.00% <0.00%> (ø)
run_visibility.py 0.00% <ø> (ø)
flows/run_imagematch.py 16.85% <1.44%> (ø)
flows/visibility.py 17.33% <1.58%> (ø)
flows/plots.py 12.59% <1.73%> (ø)
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3305323...32fbb4a. Read the comment docs.

@emirkmo
Copy link
Contributor Author

emirkmo commented Mar 3, 2022

Closign while figuring out CI

@emirkmo emirkmo closed this Mar 3, 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

Development

Successfully merging this pull request may close these issues.

Change to supporting or requiring black for code style.

1 participant