Skip to content

Commit

Permalink
Adding ruff pre-commit hook and removing isort and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaysubr committed May 31, 2024
1 parent 00d2d28 commit 12cfd57
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
18 changes: 8 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,21 @@ repos:
- id: check-merge-conflict
- id: check-yaml
args: [ --unsafe ]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.8.0
hooks:
- id: isort
args: [ "--filter-files" ]
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
additional_dependencies: ["click==8.0.4"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
exclude: conf.py
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
exclude: tests/
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.5
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
exclude: ^docs/
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license:
python tests/_license/header_check.py

format: license
isort $(sources) tests
ruff check --fix $(sources) tests
black $(sources) tests

lint: license
Expand Down
15 changes: 15 additions & 0 deletions tests/test_latlon.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

import torch

from earth2grid.latlon import equiangular_lat_lon_grid
Expand Down

0 comments on commit 12cfd57

Please sign in to comment.