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

Setting up pre-commit hooks #50

Merged
merged 7 commits into from
Aug 3, 2023
Merged

Setting up pre-commit hooks #50

merged 7 commits into from
Aug 3, 2023

Conversation

marjanalbooyeh
Copy link
Contributor

This PR add pre-commit hooks to the repository, which helps with keeping the code clean and avoids formatting confusions.

I added the following hooks which are pretty common:

  • pre-commit-hooks

    • check-yaml: checks yaml files for parseable syntax.
    • end-of-file-fixer: ensures that a file is either empty, or ends with one newline.
    • trailing-whitespace: trims trailing whitespace.
    • Line length is set to 80 for all files.
  • isort: sorts imports alphabetically and automatically separates into sections and by type.

  • flake8: for style guide enforcement.

    • note: flake8 errors can be annoying sometimes, but I think it's better to keep it as it makes the code cleaner.
    • When necessary, we can easily ignore flake8 errors for a specific line or file.

There is also pydocstyle hook for checking compliance with Python docstring conventions, which I commented for now. Lots of docstring formatting needs to be done, which takes a lot of time honestly :D I will do it slowly over time.

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #50 (db77fd5) into master (b73b93a) will not change coverage.
The diff coverage is 100.00%.

❗ Current head db77fd5 differs from pull request most recent head 99dbba3. Consider uploading reports for the commit 99dbba3 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #50   +/-   ##
=======================================
  Coverage   95.54%   95.54%           
=======================================
  Files           7        7           
  Lines         449      449           
=======================================
  Hits          429      429           
  Misses         20       20           
Files Changed Coverage Δ
cmeutils/gsd_utils.py 86.04% <ø> (ø)
cmeutils/sampling.py 100.00% <ø> (ø)
cmeutils/dynamics.py 96.00% <100.00%> (ø)
cmeutils/geometry.py 98.27% <100.00%> (ø)
cmeutils/plotting.py 100.00% <100.00%> (ø)
cmeutils/structure.py 100.00% <100.00%> (ø)

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.

2 participants