Skip to content

Commit

Permalink
Merge pull request #43 from ocefpaf/pre-commit
Browse files Browse the repository at this point in the history
Add pre-commit and modernize code
  • Loading branch information
ocefpaf authored Oct 19, 2023
2 parents b15a288 + 11d5585 commit 999f6b4
Show file tree
Hide file tree
Showing 14 changed files with 969 additions and 842 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

Expand All @@ -37,7 +37,7 @@ jobs:
- name: Test latest compliance-checker
shell: bash -l {0}
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.10') }}
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }}
run: >
micromamba remove compliance-checker --yes
&& pip install git+https://github.com/ioos/compliance-checker.git
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ env

.DS_Store
.pytest_cache
cc_plugin_glider/_version.py
cc_plugin_glider/_version.py
62 changes: 62 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-added-large-files
- id: requirements-txt-fixer
- id: file-contents-sorter
files: requirements-dev.txt

- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
exclude: >
(?x)^(
.*\.xml|
.*\.cdl
)$
args:
- --ignore-words-list=pres

- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.0
hooks:
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.2.0
hooks:
- id: pyproject-fmt

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip: []
submodules: false
1 change: 0 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ See the [ioos/compliance-checker](https://github.com/ioos/compliance-checker) fo


## Summary of the Checks
The checks have been designed to help data providers submit the highest quality data to the GliderDAC. Submitting uncompliant data to the DAC may result in services not working. For example, not providing the correct Sea Name in the GLobal atttributes may put your glider depoyment into the wrong region on the GliderMap. Not providing proper metadata about the platform and instruments, and attribution may prevent NCEI from archiving your data. And not making your files CF compliant could prevent the files from showing up on ERDDAP and THREDDS servers all together.
The checks have been designed to help data providers submit the highest quality data to the GliderDAC. Submitting uncompliant data to the DAC may result in services not working. For example, not providing the correct Sea Name in the GLobal attributes may put your glider deployment into the wrong region on the GliderMap. Not providing proper metadata about the platform and instruments, and attribution may prevent NCEI from archiving your data. And not making your files CF compliant could prevent the files from showing up on ERDDAP and THREDDS servers all together.

### High priority checks
Failures in these checks should be addressed before submitting to the GliderDAC!
Expand Down
Loading

0 comments on commit 999f6b4

Please sign in to comment.