Skip to content

Commit 9bdf22d

Browse files
authored
Merge pull request #503 from FriendsOfSymfony/spellcheck
use github action for spellcheck
2 parents a501495 + 4f4f899 commit 9bdf22d

File tree

11 files changed

+87
-36
lines changed

11 files changed

+87
-36
lines changed

.github/workflows/spellcheck.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Spellcheck
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.7
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade setuptools
23+
python -m pip install -r doc/requirements.txt
24+
- name: Run spell check
25+
run: |
26+
make -C doc/ spelling
27+
if [[ -s "doc/_build/spelling/output.txt" ]]; then echo "\nSpelling errors found\n" && cat "doc/_build/spelling/output.txt"; fi
28+
- name: Spellcheck
29+
run: |
30+
if [[ -s "doc/_build/spelling/output.txt" ]]; then cat "doc/_build/spelling/output.txt"; fi
31+
if [[ -s "doc/_build/spelling/output.txt" ]]; then false; fi

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- name: Pull in optional dependencies
1919
run: |
20-
composer require --no-update symfony/http-kernel symfony/event-dispatcher symfony/process phpunit/phpunit psr/log toflar/psr6-symfony-http-cache-store
20+
composer require --no-update symfony/http-kernel symfony/event-dispatcher symfony/process phpunit/phpunit toflar/psr6-symfony-http-cache-store
2121
composer update --no-dev --no-progress
2222
2323
- name: PHPStan

.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
sphinx:
4+
configuration: doc/conf.py
5+
6+
# additional formats
7+
formats:
8+
- pdf
9+
10+
python:
11+
version: "3.7"
12+
install:
13+
- requirements: doc/requirements.txt

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ matrix:
2323
- php: 7.3
2424
- php: 7.4
2525
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text" VARNISH_MODULES_VERSION=0.12.1
26-
#TODO re-add DOCCHECK=true - see https://github.com/FriendsOfSymfony/FOSHttpCache/pull/450
2726

2827
# PHP 8.0 (Travis does not yet support using the stable 8.0.0)
2928
- php: nightly
@@ -76,17 +75,13 @@ before_script:
7675
cat /etc/apt/sources.list
7776
sudo apt-get update -qq
7877
sudo apt-get install -qq varnish
79-
- if [ "$DOCCHECK" = true ]; then sudo apt-get install -qq python-sphinx enchant; fi
80-
- if [ "$DOCCHECK" = true ]; then sudo pip install -r doc/requirements.txt; fi
8178
- if [ "$VARNISH_MODULES_VERSION" != "" ]; then sh ./tests/install-varnish-modules.sh; fi
8279
# Install NGINX
8380
- sh ./tests/install-nginx.sh
8481

8582
script:
8683
- composer validate --strict --no-check-lock
8784
- vendor/bin/simple-phpunit $PHPUNIT_FLAGS
88-
- if [[ "$DOCCHECK" = true ]]; then make -C doc SPHINXOPTS='-nW' html; fi
89-
- if [[ "$DOCCHECK" = true ]]; then make -C doc spelling; fi
9085

9186
after_script:
9287
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

doc/_static/tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ div.configuration-block ul.simple li.selected a {
2525
color: white;
2626
}
2727

28-
div.highlight-varnish3, div.highlight-varnish {
28+
div.highlight-varnish3, div.highlight-varnish4 {
2929
border: none !important;
3030
}
3131

doc/conf.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
lexers['php'] = PhpLexer(startinline=True, linenos=1)
1111
lexers['varnish3'] = CLexer()
12-
lexers['varnish'] = CLexer()
12+
lexers['varnish4'] = CLexer()
1313

1414
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
1515
if not on_rtd: # only import and set the theme if we're building docs locally
@@ -132,10 +132,14 @@
132132
# so a file named "default.css" will overwrite the builtin "default.css".
133133
html_static_path = ['_static']
134134

135-
def setup(app):
136-
app.add_javascript('tabs.js')
137-
app.add_stylesheet('tabs.css')
138-
app.add_stylesheet('fos.css')
135+
html_js_files = [
136+
'tabs.js',
137+
]
138+
139+
html_css_files = [
140+
'tabs.css',
141+
'fos.css',
142+
]
139143

140144
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
141145
# using the given strftime format.
@@ -265,5 +269,5 @@ def setup(app):
265269

266270
config_block = {
267271
'varnish3': 'Varnish 3',
268-
'varnish': 'Varnish 4 & 5'
272+
'varnish4': 'Varnish 4 & 5'
269273
}

doc/proxy-clients.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ You need to pass the following options to the Fastly client:
179179
* ``service_identifier``: Identifier for your Fastly service account.
180180
* ``authentication_token``: User token for authentication against Fastly APIs.
181181
* NB: To be able to clear all cache(``->clear()``), you'll need a token for user with Fastly "Engineer permissions".
182-
* ``soft_purge`` (default: true): Boolean for doing soft purges or not on tag & url purging.
182+
* ``soft_purge`` (default: true): Boolean for doing soft purges or not on tag & URL purging.
183183
Soft purges expires the cache unlike hard purge (removal), and allow grace/stale handling within Fastly VCL.
184184

185185
Additionally, you can specify the request factory used to build the
@@ -364,7 +364,7 @@ All other interfaces, ``PurgeCapable``, ``RefreshCapable``, ``BanCapable``, ``Ta
364364
and ``ClearCapable`` extend this ``ProxyClient``. So each client implements at least
365365
one of the :ref:`invalidation methods <invalidation methods>` depending on
366366
the proxy server’s abilities. To interact with a proxy client directly, refer to
367-
the phpdoc on the interfaces.
367+
the documentation comments on the interfaces.
368368

369369
The ``ProxyClient`` has one method: ``flush()``. After collecting
370370
invalidation requests, ``flush()`` needs to be called to actually send the

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sphinx==1.8.5
12
git+https://github.com/fabpot/sphinx-php.git
23
sphinx-rtd-theme
34
sphinxcontrib-spelling

doc/spelling_word_list.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
admin
2+
Analytics
23
backend
34
cacheable
45
config
56
css
7+
Fastly
8+
getter
9+
getters
610
hostname
711
hostnames
812
http
@@ -27,3 +31,4 @@ Vcl
2731
inline
2832
Noop
2933
xkey
34+
ykey

doc/varnish-configuration.rst

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ To invalidate cached objects in Varnish, begin by adding an `ACL`_ (for Varnish
1414
3 see `ACL for Varnish 3`_) to your Varnish configuration. This ACL determines
1515
which IPs are allowed to issue invalidation requests. To use the provided
1616
configuration fragments, this ACL has to be named ``invalidators``. The most
17-
simple ACL, valid for all Varnish versions from 3 onwards, looks as follows:
17+
simple ACL, valid for Varnish version 3 or better, looks as follows:
1818

19-
.. code-block:: varnish
19+
.. code-block:: varnish3
2020
2121
# /etc/varnish/your_varnish.vcl
2222
@@ -59,7 +59,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
5959

6060
.. configuration-block::
6161

62-
.. code-block:: varnish
62+
.. code-block:: varnish4
6363
6464
include "path-to-config/varnish/fos_purge.vcl";
6565
@@ -100,7 +100,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
100100

101101
.. configuration-block::
102102

103-
.. code-block:: varnish
103+
.. code-block:: varnish4
104104
105105
include "path-to-config/varnish/fos_refresh.vcl";
106106
@@ -129,7 +129,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
129129

130130
.. configuration-block::
131131

132-
.. code-block:: varnish
132+
.. code-block:: varnish4
133133
134134
include "path-to-config/varnish/fos_ban.vcl";
135135
@@ -209,19 +209,17 @@ To use ``xkey``, :ref:`configure the Varnish Client for xkey <varnish_custom_tag
209209
and :ref:`the response tagger to use the xkey header <response_tagger_optional_parameters>`,
210210
and include ``resources/config/varnish/fos_tags_xkey.vcl`` in your VCL:
211211

212-
.. configuration-block::
213-
214-
.. code-block:: varnish
212+
.. code-block:: varnish4
215213
216-
include "path-to-config/varnish/fos_tags_xkey.vcl";
214+
include "path-to-config/varnish/fos_tags_xkey.vcl";
217215
218-
sub vcl_recv {
219-
call fos_tags_xkey_recv;
220-
}
216+
sub vcl_recv {
217+
call fos_tags_xkey_recv;
218+
}
221219
222-
sub vcl_deliver {
223-
call fos_tags_xkey_deliver;
224-
}
220+
sub vcl_deliver {
221+
call fos_tags_xkey_deliver;
222+
}
225223
226224
Note that there is no xkey VCL file for Varnish version 3 because the
227225
varnish-modules are only available for Varnish 4.1 or newer.
@@ -242,7 +240,7 @@ look like this:
242240
.. configuration-block::
243241

244242
.. literalinclude:: ../resources/config/varnish/fos_ban.vcl
245-
:language: varnish
243+
:language: varnish4
246244
:emphasize-lines: 17-23,50-51
247245
:linenos:
248246

@@ -288,7 +286,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
288286

289287
.. configuration-block::
290288

291-
.. code-block:: varnish
289+
.. code-block:: varnish4
292290
293291
include "path-to-config/varnish/fos_user_context.vcl";
294292
include "path-to-config/varnish/fos_user_context_url.vcl";
@@ -365,7 +363,7 @@ To make the hash request cacheable, you must extract a stable user session id
365363
*before* calling ``fos_user_context_recv``. You can do this as
366364
`explained in the Varnish documentation`_:
367365

368-
.. code-block:: varnish
366+
.. code-block:: varnish4
369367
:linenos:
370368
371369
sub vcl_recv {
@@ -397,7 +395,7 @@ Add the following to ``your_varnish.vcl``:
397395

398396
.. configuration-block::
399397

400-
.. code-block:: varnish
398+
.. code-block:: varnish4
401399
402400
include "path-to-config/varnish/fos_custom_ttl.vcl";
403401
@@ -421,7 +419,7 @@ The custom TTL header is removed before sending the response to the client.
421419
enabled for Varnish 3 by default. Check for the ``vcc_allow_inline_c``
422420
setting.
423421
If you are using Varnish 4 or newer, you are using the
424-
``varnish/fos_custom_ttl.vcl`` which uses a vmod function instead of inline C.
422+
``varnish/fos_custom_ttl.vcl`` which uses a Varnish function instead of inline C.
425423

426424
.. _varnish_debugging:
427425

@@ -438,7 +436,7 @@ To enable this feature, add the following to ``your_varnish.vcl``:
438436

439437
.. configuration-block::
440438

441-
.. code-block:: varnish
439+
.. code-block:: varnish4
442440
443441
include "path-to-config/varnish/fos_debug.vcl";
444442

phpstan.tests.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ parameters:
22
level: 1
33
paths:
44
- tests
5+
ignoreErrors:
6+
# we can add the return type declaration when dropping support for PHP < 7.4
7+
- '#Method FOS\\HttpCache\\Tests\\Unit\\SymfonyCache\\AppCache::fetch\(\) should return Symfony\\Component\\HttpFoundation\\Response but return statement is missing.#'
8+
- '#Method FOS\\HttpCache\\Tests\\Functional\\Symfony\\AppCache::fetch\(\) should return Symfony\\Component\\HttpFoundation\\Response but return statement is missing.#'

0 commit comments

Comments
 (0)