Skip to content

Commit

Permalink
pre-commit check for files over 5MB (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 authored Feb 28, 2024
1 parent b0f4407 commit 93d1822
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/linter_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
# note linter arguments are supplied via the .flake8 config file
- name: Annotate PR after running flake8
uses: TrueBrain/actions-flake8@v2

14 changes: 13 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@ repos:
hooks:
- id: black

# you can run `pre-commit autoupdate` to automatically update to the latest version of hooks!
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

ci:
autoupdate_schedule: monthly

# you can run `pre-commit autoupdate` to automatically update to the latest version of hooks!
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ icepyx

Latest release (main branch): |Docs Status main| |Travis main Build Status| |Code Coverage main|

Current development version (development branch): |Docs Status dev| |Travis dev Build Status| |Code Coverage dev|
Current development version (development branch): |Docs Status dev| |Travis dev Build Status| |Code Coverage dev| |Pre-commit dev|

.. |GitHub license| image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
:target: https://opensource.org/licenses/BSD-3-Clause
Expand Down Expand Up @@ -44,6 +44,10 @@ Current development version (development branch): |Docs Status dev| |Travis dev
.. |Code Coverage dev| image:: https://codecov.io/gh/icesat2py/icepyx/branch/development/graph/badge.svg
:target: https://codecov.io/gh/icesat2py/icepyx

.. |Pre-commit dev| image:: https://results.pre-commit.ci/badge/github/icesat2py/icepyx/development.svg
:target: https://results.pre-commit.ci/latest/github/icesat2py/icepyx/development
:alt: pre-commit.ci status


Origin and Purpose
------------------
Expand Down
7 changes: 5 additions & 2 deletions doc/source/contributing/contribution_guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ By having a *development* branch for daily work, we enable the *main* branch to

First Steps
^^^^^^^^^^^
Before you begin writing code, please first check out our issues page. Someone may already be working on the same problem, and you may be able to contribute directly to their efforts. If not, create a new issue to describe what you plan to do.
Before you begin writing code, please first check out our issues page.
Someone may already be working on the same problem, and you may be able to contribute directly to their efforts.
If not, create a new issue to describe what you plan to do.

General Guidelines
^^^^^^^^^^^^^^^^^^
Expand All @@ -73,7 +75,8 @@ General Guidelines

Basic Steps to Contribute
^^^^^^^^^^^^^^^^^^^^^^^^^
We encourage users to follow the `git pull request workflow <https://www.asmeurer.com/git-workflow/>`_. For more detailed steps, please see :ref:`How to Contribute<dev_guide_label>`.
We encourage users to follow the `git pull request workflow <https://www.asmeurer.com/git-workflow/>`_.
For more detailed steps, please see :ref:`How to Contribute<dev_guide_label>`.

Licensing
^^^^^^^^^
Expand Down
14 changes: 13 additions & 1 deletion doc/source/contributing/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,19 @@ environment (from the home level of your local copy of the icepyx repo) with
mamba env create --name icepyx-env --channel conda-forge -f requirements-dev.txt -f requirements.txt
and then pip installing icepyx as described above and below.
and then (1) running `pre-commit install` to let git know about pre-commit and
(2) pip installing icepyx as described above and below.

One of the tools installed with "requirements-dev.txt" is called [pre-commit](https://pre-commit.com/).
We have included a set of pre-commit formatting hooks that we strongly encourage all contributors to use.
These hooks will check the files you are committing for format consistency,
reformatting the files if necessary.
You can tell files were reformatted if you get a message showing one of the checks failed.
In this case, you will need to re-commit your changes until all pre-commit hooks pass
(i.e. a failed pre-commit check results in no git commit).
Pre-commit will also run on icepyx PRs using the pre-commit CI (continuous integration).
As with other automations happening in PRs,
you'll want to make sure you pull the changes back to your local version before making new commits.


Considerations with Jupyter Notebook
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tracking/citations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Presentations that feature or explain icepyx

.. bibliography:: icepyx_pubs.bib
:style: mystyle

quest2023agu
js2022agu
2022_IS2-HW-tutorials
Expand Down
6 changes: 3 additions & 3 deletions doc/source/tracking/icepyx_pubs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ @misc{quest2023agu
Abib, Nicole and
{Di Bella}, Alessandro and
Tilling, Rachel},
title = {On a {QUEST (Query, Unify, Explore SpatioTemporal)}
title = {On a {QUEST (Query, Unify, Explore SpatioTemporal)}
to Accelerate {ICESat-2} Applications in Ocean
Science via {icepyx}},
month = jan,
Expand Down Expand Up @@ -161,8 +161,8 @@ @misc{js2019agu
@INPROCEEDINGS{Bednar2023,
author={Bednar, James A. and Durant, Martin},
booktitle={Proceedings of the 22nd {Python} in Science Conference (SciPy 2023)},
title={The {Pandata} Scalable Open-Source Analysis Stack},
booktitle={Proceedings of the 22nd {Python} in Science Conference (SciPy 2023)},
title={The {Pandata} Scalable Open-Source Analysis Stack},
year={2023},
volume={},
number={},
Expand Down

0 comments on commit 93d1822

Please sign in to comment.