about summary refs log tree commit diff stats
path: root/sys/nixpkgs/pkgs/update_vim_plugins
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
committerSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
commitf2bdeaed0bcf97a880fe36cfc8a050d1643120b8 (patch)
treeba4fe9c3ddf076529701c0e776ffef2104ac23d5 /sys/nixpkgs/pkgs/update_vim_plugins
parentrefactor(treewide): Add a `.sh` extension to shell scripts (diff)
downloadnixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.tar.gz
nixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.zip
refactor(treewide): Reformat all files with treefmt
This includes getting all shellscripts to pass shellcheck. To accomplish
this, some old scripts were removed
Diffstat (limited to '')
-rwxr-xr-xsys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh18
-rw-r--r--sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml2
-rw-r--r--sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py4
3 files changed, 9 insertions, 15 deletions
diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh b/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh
index dcf8b46f..781b8aeb 100755
--- a/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh
+++ b/sys/nixpkgs/pkgs/update_vim_plugins/check-duplicates.sh
@@ -5,12 +5,10 @@ count=$(echo "$plugins" | uniq -d | wc -l)
 
 echo "duplicates count: $count"
 
-if [ "$count" -gt 0 ]
-then
+if [ "$count" -gt 0 ]; then
     filtered_plugins=$(echo "$plugins" | uniq -d)
 
-    if [ "$1" == "check-only" ]
-    then
+    if [ "$1" == "check-only" ]; then
         echo "$filtered_plugins"
         exit 1
     else
@@ -21,22 +19,18 @@ then
         # iterate over plugins we found missing and
         # compare them to all open issues.
         # We no matching issue was found, we create a new one
-        for f in $filtered_plugins # do not add " " here. It would break the plugin
-        do
+        for f in $filtered_plugins; do # do not add " " here. It would break the plugin
             found=false
 
-            for k in $known_issues
-            do
-                if [[ "$f" == "$k" ]]
-                then
+            for k in $known_issues; do
+                if [[ $f == "$k" ]]; then
                     found=true
                     break
                 fi
             done
 
             # test if matching issue was found
-            if ! $found
-            then
+            if ! $found; then
                 echo "Did not find an issue for $f. Creating a new one ..."
                 gh issue create --title "Detected broken plugin: $f" --label "bot" --body "$f"
             else
diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml b/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml
index d73a63f8..38caf76d 100644
--- a/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml
+++ b/sys/nixpkgs/pkgs/update_vim_plugins/pyproject.toml
@@ -3,7 +3,7 @@ name = "update_vim_plugins"
 version = "0.1.0"
 description = ""
 authors = ["Your Name <you@example.com>"]
-packages = [{include = "update_vim_plugins"}]
+packages = [{ include = "update_vim_plugins" }]
 
 [tool.poetry.scripts]
 update-vim-plugins = "update_vim_plugins.__main__:main"
diff --git a/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py b/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py
index 04f25ccc..edbd876b 100644
--- a/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py
+++ b/sys/nixpkgs/pkgs/update_vim_plugins/update_vim_plugins/spec.py
@@ -35,7 +35,7 @@ class PluginSpec:
         branch_regex = r"(:(?P<branch>[^:]+)?)"
         name_regex = r"(:(?P<name>[^:]+)?)"
         license_regex = r"(:(?P<license>[^:]+)?)"
-        marked_duplicate_regex = r'(:(?P<duplicate>duplicate))'
+        marked_duplicate_regex = r"(:(?P<duplicate>duplicate))"
 
         spec_regex = re.compile(
             f"^{repository_host_regex}?{owner_regex}/{repo_regex}{branch_regex}?{name_regex}?{license_regex}?{marked_duplicate_regex}?$",
@@ -60,7 +60,7 @@ class PluginSpec:
         branch = group_dict.get("branch")
         name = group_dict.get("name")
         license = group_dict.get("license")
-        marked_duplicate = bool(group_dict.get("duplicate")) # True if 'duplicate', False if None
+        marked_duplicate = bool(group_dict.get("duplicate"))  # True if 'duplicate', False if None
 
         line = spec