Skip to content

lint and automatic lint#413

Merged
wanghan-iapcm merged 4 commits intodeepmodeling:develfrom
njzjz:lint
Jan 25, 2023
Merged

lint and automatic lint#413
wanghan-iapcm merged 4 commits intodeepmodeling:develfrom
njzjz:lint

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Jan 24, 2023

Fix #344.

To lint codes, this PR uses a popular tool, pre-commit. .pre-commit-config.yaml shows all hooks used, including black and some common fixes. It can add a git hook to git commit. Thus, everything committed can be already formatted. In addition, there is also a CI to fix PRs. This way, we can ensure that everything new will also be formatted.

This PR introduces a huge change history to almost all files, but it's a necessary step to start linting our codes.

@njzjz njzjz linked an issue Jan 24, 2023 that may be closed by this pull request
@njzjz
Copy link
Member Author

njzjz commented Jan 24, 2023

The CI also fixes this PR itself.

Screenshot from 2023-01-24 18-17-02

@njzjz njzjz requested a review from wanghan-iapcm January 24, 2023 23:17
The tests failed. I think the program should allow it...
@njzjz njzjz marked this pull request as ready for review January 24, 2023 23:34
@codecov-commenter
Copy link

Codecov Report

Base: 82.40% // Head: 82.41% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (36b8cd4) compared to base (a3d2133).
Patch coverage: 83.97% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #413      +/-   ##
==========================================
+ Coverage   82.40%   82.41%   +0.01%     
==========================================
  Files          67       67              
  Lines        5950     5955       +5     
==========================================
+ Hits         4903     4908       +5     
  Misses       1047     1047              
Impacted Files Coverage Δ
dpdata/__about__.py 0.00% <0.00%> (ø)
dpdata/__init__.py 76.47% <ø> (ø)
dpdata/cli.py 0.00% <0.00%> (ø)
dpdata/md/rdf.py 0.00% <0.00%> (ø)
dpdata/plugin.py 100.00% <ø> (ø)
dpdata/plugins/3dmol.py 46.66% <25.00%> (ø)
dpdata/format.py 89.65% <28.57%> (ø)
dpdata/rdkit/sanitize.py 43.77% <32.60%> (ø)
dpdata/bond_order_system.py 68.11% <50.00%> (ø)
dpdata/driver.py 86.20% <50.00%> (ø)
... and 57 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@njzjz
Copy link
Member Author

njzjz commented Jan 25, 2023

@wanghan-iapcm if you think this resolution is ok, I also want to apply it to other projects.

Copy link
Contributor

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

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

It is a nice solution!

@wanghan-iapcm wanghan-iapcm merged commit ffa52c5 into deepmodeling:devel Jan 25, 2023
@njzjz njzjz mentioned this pull request Jan 25, 2023
@njzjz njzjz deleted the lint branch January 25, 2023 18:06
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.

Code format

3 participants