From a6455066099179cf16bee3703dfe178c66f6a075 Mon Sep 17 00:00:00 2001 From: n Date: Sat, 14 Sep 2024 21:10:52 +0200 Subject: [PATCH 1/3] move CI to Forgejo (n/playbooks#227) --- {.gitea => .forgejo}/workflows/lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename {.gitea => .forgejo}/workflows/lint.yml (95%) diff --git a/.gitea/workflows/lint.yml b/.forgejo/workflows/lint.yml similarity index 95% rename from .gitea/workflows/lint.yml rename to .forgejo/workflows/lint.yml index acf819b..a9fc6f3 100644 --- a/.gitea/workflows/lint.yml +++ b/.forgejo/workflows/lint.yml @@ -1,3 +1,4 @@ +--- name: lint run-name: lint is launched by ${{ github.actor }} on: [push] @@ -7,12 +8,12 @@ jobs: name: lint steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Forgejo!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - name: Check out repository code uses: actions/checkout@v4 - name: Install linters using Composer - run: | + run: | export COMPOSER_HOME=/tmp echo "{}" > composer.json composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true -- 2.40.1 From 10b1ee4a12736b419c89f2b5a8f2688407982c58 Mon Sep 17 00:00:00 2001 From: n Date: Sat, 14 Sep 2024 21:11:33 +0200 Subject: [PATCH 2/3] PHP-CS-Fixer fixes --- .php-cs-fixer.php | 5 +++++ shaargem.php | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .php-cs-fixer.php diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..77b7371 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,5 @@ +setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) +; diff --git a/shaargem.php b/shaargem.php index 622ae38..6f7ad36 100644 --- a/shaargem.php +++ b/shaargem.php @@ -61,8 +61,8 @@ function shaargem_init($conf) function hook_shaargem_render_editlink($data) { // fetch title only for gemini:// iris - if(isset($data['link']['url'])) { - if(strstr($data['link']['url'], "gemini://")) { + if (isset($data['link']['url'])) { + if (strstr($data['link']['url'], "gemini://")) { if ($data['link']['title'] == '') { $data['link']['title'] = fetch_iri_title($data['link']['url']); } @@ -84,8 +84,8 @@ function hook_shaargem_render_editlink($data) function hook_shaargem_save_link($data) { // ugly hack to get scheme - if(isset($_POST['lf_url'])) { - if(strstr($_POST['lf_url'], "gemini://")) { + if (isset($_POST['lf_url'])) { + if (strstr($_POST['lf_url'], "gemini://")) { $new_url = str_replace("http://", "gemini://", $data['url']); $data['url'] = $new_url; } @@ -161,7 +161,7 @@ function fetch_iri_title($iri) // status 2x ok elseif ($status[0] == 2) { $nblines = 1; - while($line = fgets($fp)) { + while ($line = fgets($fp)) { $ret = preg_match(",# (.*),", $line, $title); if ($title[0] or $nblines > 100) { break; -- 2.40.1 From a509384b53f6c8db8b15b88a75d4342bd2ff1649 Mon Sep 17 00:00:00 2001 From: n Date: Sat, 14 Sep 2024 21:12:07 +0200 Subject: [PATCH 3/3] gitignore composer stuff --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad7823d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.* -- 2.40.1