diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f744b5..dd248f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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/ diff --git a/makefile b/makefile index f5cb2a1..207939c 100644 --- a/makefile +++ b/makefile @@ -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 diff --git a/tests/test_latlon.py b/tests/test_latlon.py index 2b20940..9655f92 100644 --- a/tests/test_latlon.py +++ b/tests/test_latlon.py @@ -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