Skip to content

Commit 3adcb2a

Browse files
authored
Add Editorconfig file (#4)
* Add editorconfig * Fix files with editorconfig rules
1 parent 0cb8cff commit 3adcb2a

21 files changed

+47
-34
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
end_of_line = lf
9+
charset = utf-8
10+
tab_width = 4
11+
indent_style = space
12+
13+
[*.php]
14+
indent_size = 4
15+
16+
[*{.xml, .dist}]
17+
indent_size = 4
18+
19+
[*.md]
20+
max_line_length = 80
21+
22+
[*{.yaml, .yml}]
23+
indent_size = 4
24+
25+
[*.json]
26+
indent_size = 4

.github/workflows/tests.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
11
name: Tests
22

3-
# Controls when the action will run. Triggers the workflow on push or pull request
4-
# events but only for the master branch
3+
# Will run for every push on master and for every PR
54
on:
65
push:
76
branches: [ master ]
87
pull_request:
9-
branches: [ master ]
108

11-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
129
jobs:
13-
# This workflow contains a single job called "tests"
1410
tests:
15-
# The type of runner that the job will run on
1611
runs-on: ubuntu-latest
17-
1812
strategy:
1913
matrix:
2014
php-versions: ['7.2.0', '7.3.0', '7.4.0']
2115
name: PHP ${{ matrix.php-versions }} Test
2216

23-
# Steps represent a sequence of tasks that will be executed as part of the job
2417
steps:
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v2
2719

28-
# Validate Composer files
2920
- name: Validate composer.json and composer.lock
3021
run: composer validate
3122

32-
# Install dependencies
3323
- name: Install dependencies
3424
run: composer install --prefer-dist --no-progress --no-suggest
3525

36-
# Run MeiliSearch Docker instance
3726
- name: Docker setup
3827
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
3928

40-
# Run test suite
4129
- name: Run test suite
4230
run: composer test:unit
4331

44-
# Run PHP CS Fixer
4532
- name: Run linter
4633
run: composer lint:check

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
</exclude>
2525
</whitelist>
2626
</filter>
27-
</phpunit>
27+
</phpunit>

src/Resources/config/doctrine/Aggregator.mongodb.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
<id field-name="objectID"/>
99
</mapped-superclass>
1010

11-
</doctrine-mongo-mapping>
11+
</doctrine-mongo-mapping>

src/Resources/config/doctrine/Aggregator.orm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
</id>
1111
</mapped-superclass>
1212

13-
</doctrine-mapping>
13+
</doctrine-mapping>

tests/BaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ protected function getFileName(string $indexName, string $type): string
164164
{
165165
return sprintf('%s/%s.json', $indexName, $type);
166166
}
167-
}
167+
}

tests/Entity/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ public function setPost(Post $post): Comment
104104

105105
return $this;
106106
}
107-
}
107+
}

tests/Entity/ContentAggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public static function getEntities(): array
2828
Image::class,
2929
];
3030
}
31-
}
31+
}

tests/Entity/EmptyAggregator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
class EmptyAggregator extends Aggregator
1212
{
1313

14-
}
14+
}

tests/Entity/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ public function isPublic(): bool
6262
{
6363
return true;
6464
}
65-
}
65+
}

tests/Entity/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ public function normalize(NormalizerInterface $normalizer, $format = null, array
6363

6464
return [];
6565
}
66-
}
66+
}

tests/Entity/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ public function removeComment(Comment $comment): Post
143143

144144
return $this;
145145
}
146-
}
146+
}

tests/Entity/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ public function normalize(NormalizerInterface $normalizer, $format = null, array
7878

7979
return true;
8080
}
81-
}
81+
}

tests/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3838
$loader->load(__DIR__ . '/config/meili_search.yaml');
3939
$loader->load(__DIR__ . '/config/services.yaml');
4040
}
41-
}
41+
}

tests/Normalizer/CommentNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ public function supportsNormalization($data, $format = null)
3131
{
3232
return $data instanceof Comment;
3333
}
34-
}
34+
}

tests/TestCase/AggregatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ public function testAggregatorProxyClass()
7878
$this->assertNotEmpty($serializedData);
7979
$this->assertEquals('objectId', $serializedData['objectID']);
8080
}
81-
}
81+
}

tests/TestCase/CommandsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ public function testSearchImportAggregator()
147147
$this->connection->executeUpdate($this->platform->getTruncateTableSQL($this->indexName, true));
148148
$this->cleanUp();
149149
}
150-
}
150+
}

tests/TestCase/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ public function dataTestConfigurationTree(): array
9696
],
9797
];
9898
}
99-
}
99+
}

tests/TestCase/EngineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ public function testIndexingEmptyEntity()
4848
$this->assertInstanceOf(HTTPRequestException::class, $e);
4949
}
5050
}
51-
}
51+
}

tests/TestCase/SerializationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ public function testSimpleEntityToSearchableArray()
7272

7373
$this->assertEquals($expected, $searchablePost->getSearchableArray());
7474
}
75-
}
75+
}

tests/TestCase/SettingsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ public function testUpdateSettings()
104104
$this->assertEquals(['title', 'publishedAt'], $settings['attributesForFaceting']);
105105
}
106106

107-
}
107+
}

0 commit comments

Comments
 (0)