Skip to content

Commit

Permalink
Move fix reports (classes and schemas)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Apr 19, 2021
1 parent 2638d59 commit 552bf42
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Expand Up @@ -5,7 +5,7 @@
/tests/Differ/AbstractDifferTestCase.php export-ignore
/tests/Fixtures/ export-ignore
/tests/Linter/AbstractLinterTestCase.php export-ignore
/tests/Report/AbstractReporterTestCase.php export-ignore
/tests/Console/Report/FixReport/AbstractReporterTestCase.php export-ignore
/tests/Test/AbstractFixerWithAliasedOptionsTestCase.php export-ignore
/tests/Test/AbstractTransformerTestCase.php export-ignore

Expand Down
3 changes: 0 additions & 3 deletions doc/config.rst
Expand Up @@ -71,6 +71,3 @@ configure them in your config file.
->setIndent("\t")
->setLineEnding("\r\n")
;
By using ``--using-cache`` option with ``yes`` or ``no`` you can set if the caching
mechanism should be used.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions doc/usage.rst
Expand Up @@ -20,10 +20,12 @@ to merge paths from the config file and from the argument:
The ``--format`` option for the output format. Supported formats are ``txt`` (default one), ``json``, ``xml``, ``checkstyle``, ``junit`` and ``gitlab``.

NOTE: the output for the following formats are generated in accordance with XML schemas
NOTE: the output for the following formats are generated in accordance with schemas

* ``checkstyle`` follows the common `"checkstyle" xml schema </doc/report-schema/checkstyle.xsd>`_
* ``junit`` follows the `JUnit xml schema from Jenkins </doc/report-schema/junit-10.xsd>`_
* ``checkstyle` follows the common `"checkstyle" XML schema </doc/schemas/fix/checkstyle.xsd>`_
* ``json` follows the `own JSON schema </doc/schemas/fix/schema.json>`_
* ``junit`` follows the `JUnit XML schema from Jenkins </doc/schemas/fix/junit-10.xsd>`_
* ``xml`` follows the `own XML schema </doc/schemas/fix/xml.xsd>`_

The ``--quiet`` Do not output any message.

Expand Down
4 changes: 2 additions & 2 deletions src/Console/Command/FixCommand.php
Expand Up @@ -18,8 +18,8 @@
use PhpCsFixer\Console\Output\ErrorOutput;
use PhpCsFixer\Console\Output\NullOutput;
use PhpCsFixer\Console\Output\ProcessOutput;
use PhpCsFixer\Console\Report\FixReport\ReportSummary;
use PhpCsFixer\Error\ErrorsManager;
use PhpCsFixer\Report\ReportSummary;
use PhpCsFixer\Runner\Runner;
use PhpCsFixer\ToolInfoInterface;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -98,7 +98,7 @@ protected function configure()
->setDefinition(
[
new InputArgument('path', InputArgument::IS_ARRAY, 'The path.'),
new InputOption('path-mode', '', InputOption::VALUE_REQUIRED, 'Specify path mode (can be override or intersection).', 'override'),
new InputOption('path-mode', '', InputOption::VALUE_REQUIRED, 'Specify path mode (can be override or intersection).', ConfigurationResolver::PATH_MODE_OVERRIDE),
new InputOption('allow-risky', '', InputOption::VALUE_REQUIRED, 'Are risky fixers allowed (can be yes or no).'),
new InputOption('config', '', InputOption::VALUE_REQUIRED, 'The path to a .php_cs file.'),
new InputOption('dry-run', '', InputOption::VALUE_NONE, 'Only shows which files would have been modified.'),
Expand Down
8 changes: 5 additions & 3 deletions src/Console/Command/HelpCommand.php
Expand Up @@ -67,10 +67,12 @@ public static function getHelpCopy()
The <comment>--format</comment> option for the output format. Supported formats are `txt` (default one), `json`, `xml`, `checkstyle`, `junit` and `gitlab`.
NOTE: the output for the following formats are generated in accordance with XML schemas
NOTE: the output for the following formats are generated in accordance with schemas
* `checkstyle` follows the common `"checkstyle" xml schema </doc/report-schema/checkstyle.xsd>`_
* `junit` follows the `JUnit xml schema from Jenkins </doc/report-schema/junit-10.xsd>`_
* `checkstyle` follows the common `"checkstyle" XML schema </doc/schemas/fix/checkstyle.xsd>`_
* `json` follows the `own JSON schema </doc/schemas/fix/schema.json>`_
* `junit` follows the `JUnit XML schema from Jenkins </doc/schemas/fix/junit-10.xsd>`_
* `xml` follows the `own XML schema </doc/schemas/fix/xml.xsd>`_
The <comment>--quiet</comment> Do not output any message.
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConfigurationResolver.php
Expand Up @@ -21,6 +21,8 @@
use PhpCsFixer\Cache\Signature;
use PhpCsFixer\ConfigInterface;
use PhpCsFixer\ConfigurationException\InvalidConfigurationException;
use PhpCsFixer\Console\Report\FixReport\ReporterFactory;
use PhpCsFixer\Console\Report\FixReport\ReporterInterface;
use PhpCsFixer\Differ\DifferInterface;
use PhpCsFixer\Differ\NullDiffer;
use PhpCsFixer\Differ\SebastianBergmannDiffer;
Expand All @@ -31,8 +33,6 @@
use PhpCsFixer\FixerFactory;
use PhpCsFixer\Linter\Linter;
use PhpCsFixer\Linter\LinterInterface;
use PhpCsFixer\Report\ReporterFactory;
use PhpCsFixer\Report\ReporterInterface;
use PhpCsFixer\RuleSet\RuleSet;
use PhpCsFixer\StdinFileInfo;
use PhpCsFixer\ToolInfoInterface;
Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use Symfony\Component\Console\Formatter\OutputFormatter;

Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use Symfony\Component\Console\Formatter\OutputFormatter;

Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use Symfony\Component\Console\Formatter\OutputFormatter;

Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use PhpCsFixer\Preg;
use Symfony\Component\Console\Formatter\OutputFormatter;
Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

/**
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use Symfony\Component\Finder\Finder as SymfonyFinder;
use Symfony\Component\Finder\SplFileInfo;
Expand Down
Expand Up @@ -10,10 +10,12 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

/**
* @author Boris Gorbylev <ekho@ekho.name>
*
* @internal
*/
interface ReporterInterface
{
Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use PhpCsFixer\Differ\DiffConsoleFormatter;

Expand Down
Expand Up @@ -10,7 +10,7 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Report;
namespace PhpCsFixer\Console\Report\FixReport;

use Symfony\Component\Console\Formatter\OutputFormatter;

Expand Down
Expand Up @@ -10,10 +10,10 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\ReporterInterface;
use PhpCsFixer\Report\ReportSummary;
use PhpCsFixer\Console\Report\FixReport\ReporterInterface;
use PhpCsFixer\Console\Report\FixReport\ReportSummary;
use PhpCsFixer\Tests\TestCase;

/**
Expand Down
Expand Up @@ -10,18 +10,18 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Console\Report\FixReport\CheckstyleReporter;
use PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint\XmlMatchesXsd;
use PhpCsFixer\Report\CheckstyleReporter;
use Symfony\Component\Console\Formatter\OutputFormatter;

/**
* @author Kévin Gomez <contact@kevingomez.fr>
*
* @internal
*
* @covers \PhpCsFixer\Report\CheckstyleReporter
* @covers \PhpCsFixer\Console\Report\FixReport\CheckstyleReporter
*/
final class CheckstyleReporterTest extends AbstractReporterTestCase
{
Expand All @@ -34,7 +34,7 @@ final class CheckstyleReporterTest extends AbstractReporterTestCase

public static function doSetUpBeforeClass()
{
self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/checkstyle.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/checkstyle.xsd');
}

public static function doTearDownAfterClass()
Expand Down
Expand Up @@ -10,15 +10,15 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\GitlabReporter;
use PhpCsFixer\Console\Report\FixReport\GitlabReporter;

/**
* @author Hans-Christian Otto <c.otto@suora.com>
*
* @internal
* @covers \PhpCsFixer\Report\GitlabReporter
* @covers \PhpCsFixer\Console\Report\FixReport\GitlabReporter
*/
final class GitlabReporterTest extends AbstractReporterTestCase
{
Expand Down
Expand Up @@ -10,17 +10,17 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\JsonReporter;
use PhpCsFixer\Console\Report\FixReport\JsonReporter;

/**
* @author Boris Gorbylev <ekho@ekho.name>
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* @internal
*
* @covers \PhpCsFixer\Report\JsonReporter
* @covers \PhpCsFixer\Console\Report\FixReport\JsonReporter
*/
final class JsonReporterTest extends AbstractReporterTestCase
{
Expand Down Expand Up @@ -153,7 +153,7 @@ protected function assertFormat($expected, $input)
*/
private static function assertJsonSchema($json)
{
$jsonPath = __DIR__.'/../../doc/report-schema/schema.json';
$jsonPath = __DIR__.'/../../../../doc/schemas/fix/schema.json';

$data = json_decode($json);

Expand Down
Expand Up @@ -10,10 +10,10 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Console\Report\FixReport\JunitReporter;
use PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint\XmlMatchesXsd;
use PhpCsFixer\Report\JunitReporter;
use Symfony\Component\Console\Formatter\OutputFormatter;

/**
Expand All @@ -22,7 +22,7 @@
*
* @internal
*
* @covers \PhpCsFixer\Report\JunitReporter
* @covers \PhpCsFixer\Console\Report\FixReport\JunitReporter
*/
final class JunitReporterTest extends AbstractReporterTestCase
{
Expand All @@ -39,7 +39,7 @@ public static function doSetUpBeforeClass()
{
parent::doSetUpBeforeClass();

self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/junit-10.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/junit-10.xsd');
}

public static function doTearDownAfterClass()
Expand Down
Expand Up @@ -10,17 +10,17 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\ReportSummary;
use PhpCsFixer\Console\Report\FixReport\ReportSummary;
use PhpCsFixer\Tests\TestCase;

/**
* @author SpacePossum
*
* @internal
*
* @covers \PhpCsFixer\Report\ReportSummary
* @covers \PhpCsFixer\Console\Report\FixReport\ReportSummary
*/
final class ReportSummaryTest extends TestCase
{
Expand Down
Expand Up @@ -10,17 +10,17 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\ReporterFactory;
use PhpCsFixer\Console\Report\FixReport\ReporterFactory;
use PhpCsFixer\Tests\TestCase;

/**
* @author Boris Gorbylev <ekho@ekho.name>
*
* @internal
*
* @covers \PhpCsFixer\Report\ReporterFactory
* @covers \PhpCsFixer\Console\Report\FixReport\ReporterFactory
*/
final class ReporterFactoryTest extends TestCase
{
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testGetNonRegisteredReport()

private function createReporterDouble($format)
{
$reporter = $this->prophesize(\PhpCsFixer\Report\ReporterInterface::class);
$reporter = $this->prophesize(\PhpCsFixer\Console\Report\FixReport\ReporterInterface::class);
$reporter->getFormat()->willReturn($format);

return $reporter->reveal();
Expand Down
Expand Up @@ -10,17 +10,17 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Report\TextReporter;
use PhpCsFixer\Console\Report\FixReport\TextReporter;

/**
* @author Boris Gorbylev <ekho@ekho.name>
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* @internal
*
* @covers \PhpCsFixer\Report\TextReporter
* @covers \PhpCsFixer\Console\Report\FixReport\TextReporter
*/
final class TextReporterTest extends AbstractReporterTestCase
{
Expand Down
Expand Up @@ -10,10 +10,10 @@
* with this source code in the file LICENSE.
*/

namespace PhpCsFixer\Tests\Report;
namespace PhpCsFixer\Tests\Console\Report\FixReport;

use PhpCsFixer\Console\Report\FixReport\XmlReporter;
use PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint\XmlMatchesXsd;
use PhpCsFixer\Report\XmlReporter;
use Symfony\Component\Console\Formatter\OutputFormatter;

/**
Expand All @@ -22,7 +22,7 @@
*
* @internal
*
* @covers \PhpCsFixer\Report\XmlReporter
* @covers \PhpCsFixer\Console\Report\FixReport\XmlReporter
*/
final class XmlReporterTest extends AbstractReporterTestCase
{
Expand All @@ -35,7 +35,7 @@ public static function doSetUpBeforeClass()
{
parent::doSetUpBeforeClass();

self::$xsd = file_get_contents(__DIR__.'/../../doc/report-schema/xml.xsd');
self::$xsd = file_get_contents(__DIR__.'/../../../../doc/schemas/fix/xml.xsd');
}

public static function doTearDownAfterClass()
Expand Down

0 comments on commit 552bf42

Please sign in to comment.