ci #7
2 changed files with 34 additions and 5 deletions
27
.gitea/workflows/lint.yml
Normal file
27
.gitea/workflows/lint.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
name: lint
|
||||||
|
run-name: lint is launched by ${{ github.actor }}
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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 "🔎 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: |
|
||||||
|
export COMPOSER_HOME=/tmp
|
||||||
|
echo "{}" > composer.json
|
||||||
|
composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true
|
||||||
|
composer require --dev bamarni/composer-bin-plugin
|
||||||
|
composer bin phplint require --dev overtrue/phplint
|
||||||
|
composer require --dev friendsofphp/php-cs-fixer
|
||||||
|
- name: Lint
|
||||||
|
run: vendor/bin/phplint --no-cache --no-progress --exclude=vendor --verbose
|
||||||
|
- name: PHP CS Fixer
|
||||||
|
run: vendor/bin/php-cs-fixer fix --dry-run --verbose --diff .
|
||||||
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|
10
clickat.php
10
clickat.php
|
@ -16,10 +16,12 @@ function hook_clickat_render_linklist($data)
|
||||||
'/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' <a href="https://\2/@\1">@\1</a>',
|
'/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' <a href="https://\2/@\1">@\1</a>',
|
||||||
'/\ @([\w\d]+)/' => ' <a href="https://twitter.com/\1">@\1</a>'
|
'/\ @([\w\d]+)/' => ' <a href="https://twitter.com/\1">@\1</a>'
|
||||||
);
|
);
|
||||||
foreach ($data['links'] as &$value)
|
foreach ($data['links'] as &$value) {
|
||||||
if (strpos($value['description'],' @') !== false)
|
if (strpos($value['description'], ' @') !== false) {
|
||||||
foreach($patterns as $nic => $link)
|
foreach($patterns as $nic => $link) {
|
||||||
$value['description'] = preg_replace($nic, $link, $value['description']);
|
$value['description'] = preg_replace($nic, $link, $value['description']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue