Skip to content

Commit

Permalink
fish: Add git_py_files
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Dec 20, 2024
1 parent e52adb5 commit 080e382
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fish/functions/git_py_files.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env fish
# SPDX-License-Identifier: MIT
# Copyright (C) 2024 Nathan Chancellor

function git_py_files -d "Get Python files checked into current repository for linting"
# Get list of files, specifically excluding this one, as it is a false
# positive due to the command used :) We pass through realpath and uniq
# to handle files that may be symlinked multiple times like korg_tc,
# which can make linting annoying otherwise
set files (git ls-files | grep -Fv (status function).fish | xargs realpath | uniq | string replace "$PWD/" '')

# Sort after ripgrep because sorting within ripgrep reduces parallelism
rg -l '#!/usr/bin/env python' $files | sort
end

0 comments on commit 080e382

Please sign in to comment.