Skip to content

Commit

Permalink
Apply ruff/refurb rule FURB118
Browse files Browse the repository at this point in the history
	FURB118 Use `operator.itemgetter(slice(7))` instead of defining a function
  • Loading branch information
DimitriPapadopoulos committed May 9, 2024
1 parent d37c280 commit 6d46996
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/setuptools_scm/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dataclasses
import logging
import operator
import os
import re
import shlex
Expand Down Expand Up @@ -144,8 +145,7 @@ def fetch_shallow(self) -> None:
run_git(["fetch", "--unshallow"], self.path, check=True, timeout=240)

def node(self) -> str | None:
def _unsafe_short_node(node: str) -> str:
return node[:7]
_unsafe_short_node = operator.itemgetter(slice(7))

return run_git(
["rev-parse", "--verify", "--quiet", "HEAD"], self.path
Expand Down

0 comments on commit 6d46996

Please sign in to comment.