Skip to content

Add Editorconfig file #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://editorconfig.org/

root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
charset = utf-8
tab_width = 4
indent_style = space

[*.php]
indent_size = 4

[*{.xml, .dist}]
indent_size = 4

[*.md]
max_line_length = 80

[*{.yaml, .yml}]
indent_size = 4

[*.json]
indent_size = 4
17 changes: 2 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
name: Tests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# Will run for every push on master and for every PR
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "tests"
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.2.0', '7.3.0', '7.4.0']
name: PHP ${{ matrix.php-versions }} Test

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

# Validate Composer files
- name: Validate composer.json and composer.lock
run: composer validate

# Install dependencies
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

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

# Run test suite
- name: Run test suite
run: composer test:unit

# Run PHP CS Fixer
- name: Run linter
run: composer lint:check
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
</exclude>
</whitelist>
</filter>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/Aggregator.mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<id field-name="objectID"/>
</mapped-superclass>

</doctrine-mongo-mapping>
</doctrine-mongo-mapping>
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/Aggregator.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
</id>
</mapped-superclass>

</doctrine-mapping>
</doctrine-mapping>
2 changes: 1 addition & 1 deletion tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ protected function getFileName(string $indexName, string $type): string
{
return sprintf('%s/%s.json', $indexName, $type);
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ public function setPost(Post $post): Comment

return $this;
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/ContentAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ public static function getEntities(): array
Image::class,
];
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/EmptyAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
class EmptyAggregator extends Aggregator
{

}
}
2 changes: 1 addition & 1 deletion tests/Entity/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public function isPublic(): bool
{
return true;
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ public function normalize(NormalizerInterface $normalizer, $format = null, array

return [];
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ public function removeComment(Comment $comment): Post

return $this;
}
}
}
2 changes: 1 addition & 1 deletion tests/Entity/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ public function normalize(NormalizerInterface $normalizer, $format = null, array

return true;
}
}
}
2 changes: 1 addition & 1 deletion tests/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load(__DIR__ . '/config/meili_search.yaml');
$loader->load(__DIR__ . '/config/services.yaml');
}
}
}
2 changes: 1 addition & 1 deletion tests/Normalizer/CommentNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public function supportsNormalization($data, $format = null)
{
return $data instanceof Comment;
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/AggregatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ public function testAggregatorProxyClass()
$this->assertNotEmpty($serializedData);
$this->assertEquals('objectId', $serializedData['objectID']);
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/CommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ public function testSearchImportAggregator()
$this->connection->executeUpdate($this->platform->getTruncateTableSQL($this->indexName, true));
$this->cleanUp();
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public function dataTestConfigurationTree(): array
],
];
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/EngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function testIndexingEmptyEntity()
$this->assertInstanceOf(HTTPRequestException::class, $e);
}
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/SerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ public function testSimpleEntityToSearchableArray()

$this->assertEquals($expected, $searchablePost->getSearchableArray());
}
}
}
2 changes: 1 addition & 1 deletion tests/TestCase/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ public function testUpdateSettings()
$this->assertEquals(['title', 'publishedAt'], $settings['attributesForFaceting']);
}

}
}