Skip to content

Commit 03c62cb

Browse files
authored
Merge pull request #372 from dunglas/proselint
Run Proselint in the CI and fix some errors
2 parents 74ebd27 + 6e4bce5 commit 03c62cb

File tree

17 files changed

+40
-34
lines changed

17 files changed

+40
-34
lines changed

.proselintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"checks": {
3+
"typography.symbols": false,
4+
"typography.exclamation": false,
5+
"cliches.misc": false
6+
}
7+
}

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ env:
88
secure: gjiWHIgNjLXuEFmLiepiOTHOuauHfeKHutrE0sBwFZUQzP9FoGTZzJub1z8/vm+hhygA+TZbB0iclygHyNrXCkZyNdnZXChXl4iPdYqY3OARPOAbQff16+/XSUDsZ/Ok1etdb3kKor1R4rBt/WywBvXmmdggumTA3yT5ExI+dyomdONo4yMUZ7g1la0ehMEzGqyVjt0nUW31PN3l6dI1qgigHCuotSrrpWP6fTXuUh5l6YA7KXb/V1hJxaGENLz1Cdfk0sF66e4KsV/DX6JZSqpvdqVB8OTPU+si511yJtGS8OeuLs4RqmXMLrY/ChCodlYnfCE+NleBFpUnCVqth/RDRh7LvplUJlpsXNcfyoA3mOFmZa0euOMCqJ3qwESz802Y9c5oN63hn2OUF/raFDc3SMMC86FFHxwyYjz5+yzXYupnFNj39NKdQ1v1KBbY8BD8UT8RU3mlu4/3LRz0tSamREHj3pGgBmvgUZfUE1dMngeaZjOmBaIZH8TnKQ75CvfnoT+LJnZo6g9g4uwz6jtaIziSMZ0OW/95nF8yx+xONbHEtt5ex5M09NOFsN2vB2bcUAgIjyGrmmNLQadwJyQv557IGPEE5CyGhJpXh9XZ+WMw2vO45MOw4sQPkARF6OJkMteqFc2NLXMOQJ07EScbgEKR/9VOcyxIk/7a7nc=
99

1010
install:
11+
- pip install --user proselint
12+
- cp .proselintrc ~
1113
- cd ..
1214
- git clone https://github.com/api-platform/website.git
1315
- cd website
1416
- yarn install
1517
- ln -s $TRAVIS_BUILD_DIR src/pages/docs
18+
- cd $TRAVIS_BUILD_DIR
1619

1720
script:
21+
- find . -name '*.md' ! -name 'conduct.md' ! -name 'heroku.md' -exec proselint {} \;
1822
- cd $TRAVIS_BUILD_DIR/../website
1923
- bin/generate-nav
2024
- yarn gatsby build

admin/handling-relations-to-collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Currently, API Platform Admin doesn't handle `to-many` relations. The core library [is being patched](https://github.com/api-platform/core/pull/1189)
44
to document relations to collections through OWL.
55

6-
In the meantime, it is possible to manually configure API Platform to handle relations to collections.
6+
Meanwhile, it is possible to manually configure API Platform to handle relations to collections.
77

88
We will create the admin for an API exposing `Person` and `Book` resources linked with a `many-to-many`
99
relation between them (trough the `authors` property).

admin/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The API Platform Admin
22

3-
API Platform Admin is a tool to automatically create a fancy (Material Design) and fully-featured administration interface
3+
API Platform Admin is a tool to automatically create a fancy (Material Design) and fully featured administration interface
44
for any API supporting [the Hydra Core Vocabulary](http://www.hydra-cg.com/), including but not limited to all APIs created
55
using [the API Platform framework](https://api-platform.com).
66

client-generator/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ specified the documentation URL instead of the entrypoint. For example if you ar
1414
documentation URL is at [https://demo.api-platform.com/docs](https://demo.api-platform.com/docs) the entry point is
1515
likely at [https://demo.api-platform.com](https://demo.api-platform.com). You can see an example of the expected
1616
response from an entrypoint in your browser by clicking visiting
17-
[https://demo.api-platform.com/index.jsonld](https://demo.api-platform.com/index.jsonld).
17+
[https://demo.api-platform.com/index.jsonld](https://demo.api-platform.com/index.jsonld).
1818

1919
* If you receive `TypeError: Cannot read property '@type' of undefined` or `TypeError: Cannot read property '0'
20-
of undefined` check that the URL you specified is accessible and returns jsonld. You can check from the command line
20+
of undefined` check that the URL you specified is accessible and returns jsonld. You can check from the command line
2121
you are using by running something like `curl https://demo.api-platform.com/`.
2222

2323
* If you receive a message like this:

core/content-negotiation.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@ JSON | `json` |
2424
XML | `xml` | `application/xml`, `text/xml` | no
2525
HTML (API docs) | `html` | `text/html` | no
2626

27-
2827
If the client requested format is not specified (if it's not supported, it will throw an HTTP bad format error), the response format will be the first format defined in the `formats` configuration key (see below).
2928
An example using the builtin XML support is available in [Behat specs](https://github.com/api-platform/core/blob/master/features/main/content_negotiation.feature).
3029

31-
32-
The API Platform content negotiation system is extensible. Support for other formats (such as [JSONAPI](http://jsonapi.org/))
30+
The API Platform content negotiation system is extendable. Support for other formats (such as [JSONAPI](http://jsonapi.org/))
3331
can be added by [creating and registering appropriate encoders and, sometimes, normalizers](https://symfony.com/doc/current/serializer.html#adding-normalizers-and-encoders). Adding support for other
34-
standard hypermedia formats upstream is very welcome. Don't hesitate to contribute by adding your encoders and normalizers
32+
standard hypermedia formats upstream is welcome. Don't hesitate to contribute by adding your encoders and normalizers
3533
to API Platform Core.
3634

37-
3835
## Enabling Several Formats
3936

4037
The first required step is to configure allowed formats. The following configuration will enable the support of XML (built-in)
@@ -68,13 +65,11 @@ API Platform Core will automatically call the serializer with your defined forma
6865
as `format` parameter during the deserialization process. Then it will return the result to the client with the asked MIME
6966
type using its built-in responder.
7067

71-
7268
## Writing a Custom Normalizer
7369

7470
Using composition is the recommended way to implement a custom normalizer. You can use the following template to start with your
7571
own implementation of `CustomItemNormalizer`:
7672

77-
7873
```yaml
7974
# app/config/services.yml
8075
services:

core/data-providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ORM](http://www.doctrine-project.org/projects/orm.html) to retrieve data from a
55
is enabled by default. This data provider natively supports paged collections and filters. It can be used as is and fits
66
perfectly with common usages.
77

8-
But sometime, you want to retrieve data from other sources such as another persistence layer, a webservice, ElasticSearch
8+
However, you sometime want to retrieve data from other sources such as another persistence layer, a webservice, ElasticSearch
99
or MongoDB.
1010
Custom data providers can be used to do so. A project can include as many data providers as it needs. The first able to
1111
retrieve data for a given resource will be used.

core/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ of event listeners are executed which validate the data, persist it in database,
99
and create an HTTP response that will be sent to the client.
1010

1111
To do so, API Platform Core leverages [events triggered by the Symfony HTTP Kernel](https://symfony.com/doc/current/reference/events.html#kernel-events).
12-
You can also hook your own code to those events. They are very handy and powerful extension points available at all points
12+
You can also hook your own code to those events. They are handy and powerful extension points available at all points
1313
of the request lifecycle.
1414

1515
In the following example, we will send a mail each time a new book is created using the API:

core/form-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Accept `application/x-www-form-urlencoded` Form Data
22

33
API Platform only supports raw documents as request input (encoded in JSON, XML, YAML...). This has many advantages including support of types and the ability to send back to the API documents originally retrieved through a `GET` request.
4-
But sometimes - for instance, to support legacy clients - it is necessary to accept inputs encoded in the traditional [`application/x-www-form-urlencoded`](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1) format (HTML form content type). This can easily be done using [the powerful event system](events.md) of the framework.
4+
However, sometimes - for instance, to support legacy clients - it is necessary to accept inputs encoded in the traditional [`application/x-www-form-urlencoded`](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1) format (HTML form content type). This can easily be done using [the powerful event system](events.md) of the framework.
55

66
In this tutorial, we will decorate the default `DeserializeListener` class to handle form data if applicable, and delegate to the built-in listener for other cases.
77

core/fosuser-bundle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
API Platform Core is shipped with a bridge for [FOSUserBundle](https://github.com/FriendsOfSymfony/FOSUserBundle).
44
If the FOSUser bundle is enabled, this bridge will use its `UserManager` to create, update and delete user resources.
55

6-
Note: FOSUserBundle is not very well suited for APIs. We strongly encourage you to use the [Doctrine user provider](https://symfony.com/doc/current/security/entity_provider.html)
6+
Note: FOSUserBundle is not well suited for APIs. We strongly encourage you to use the [Doctrine user provider](https://symfony.com/doc/current/security/entity_provider.html)
77
shipped with Symfony or to [create a custom user provider](http://symfony.com/doc/current/security/custom_provider.html)
88
instead of using this bundle.
99

0 commit comments

Comments
 (0)