Skip to content
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

Merge release 0.5.0 into 1.0.x #170

Merged
merged 45 commits into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
06ad59a
Declare past, current and upcoming branches
greg0ire Apr 6, 2021
37dba6f
Use private visibility by default
greg0ire Mar 27, 2021
9a796f6
Make classes final by default
greg0ire Apr 14, 2021
b4db342
Merge pull request #147 from greg0ire/update-branch-metadata
greg0ire Apr 15, 2021
4395342
Add configuration option to support github output (#149)
Nyholm Apr 26, 2021
4e2516d
Merge pull request #144 from greg0ire/close-api
greg0ire Apr 26, 2021
620432d
Adding an Error object
Nyholm Apr 25, 2021
ab4af20
Remove deprecation layer
Nyholm May 13, 2021
a5d1702
Fixed tests
Nyholm May 13, 2021
241b83a
minors
Nyholm May 13, 2021
23a8c7a
Merge pull request #151 from doctrine/0.4.x
greg0ire May 13, 2021
c4ac6f1
Merge pull request #148 from Nyholm/error
greg0ire May 16, 2021
abc2ceb
Added note about the updated Error Handling
Nyholm May 16, 2021
bc175a1
Merge pull request #152 from Nyholm/upgrate-docs-error
greg0ire May 16, 2021
a988c1f
Fix exception message formatting in TableNode
norkunas Jun 30, 2021
5402402
Merge pull request #153 from norkunas/fix-formatting
greg0ire Jun 30, 2021
ade7d1d
Fix parsing definition list term
wouterj Jul 8, 2021
55253fc
Merge pull request #154 from wouterj/sf-108
greg0ire Jul 9, 2021
451cddf
Close open sections of greater or equal level
weaverryan Dec 16, 2018
b692368
Merge pull request #74 from weaverryan/over-closing-nesting-issue
greg0ire Jul 9, 2021
22e99f8
Merge pull request #155 from doctrine/0.4.x-merge-up-into-0.5.x_N0bq1Q74
greg0ire Jul 11, 2021
35c61ec
Add more optional debugging features (#158)
javiereguiluz Sep 8, 2021
741726b
Add support for non-Latin scripts in titles
javiereguiluz Oct 13, 2021
5725e06
Fix code syntax
javiereguiluz Oct 13, 2021
c2617ae
Require dependencies compatible with PHP 7.1
javiereguiluz Oct 13, 2021
646b96c
Upgrade the minimum required PHP version to 7.2
javiereguiluz Oct 13, 2021
3deb34c
Update GitHub actions configuration
javiereguiluz Oct 13, 2021
19c5274
Merge pull request #159 from javiereguiluz/non_latin_support
greg0ire Oct 13, 2021
babbc41
Reuse workflows from upstream
greg0ire Oct 14, 2021
c205757
Merge pull request #160 from greg0ire/reuse-workflows
greg0ire Oct 14, 2021
0d676b1
Explicitly pass secrets to release workflow
greg0ire Oct 14, 2021
a629d72
Merge pull request #161 from greg0ire/pass-secrets-explicitly
greg0ire Oct 14, 2021
460a8a9
Merge remote-tracking branch 'origin/0.4.x' into 162--0.4.x-merge-up-…
greg0ire Oct 14, 2021
3ef14c1
Merge pull request #162 from doctrine/0.4.x-merge-up-into-0.5.x_wWbHwUh8
greg0ire Oct 14, 2021
07b6b5b
Relax the requirement of symfony/translation-contracts dependency
javiereguiluz Oct 15, 2021
1d7e578
Merge pull request #163 from javiereguiluz/patch-1
greg0ire Oct 15, 2021
1dda6fd
Merge pull request #164 from doctrine/0.4.x-merge-up-into-0.5.x_rZlKqysJ
greg0ire Oct 15, 2021
0fd974e
Fixing bug where indented table header was seen as a dl
weaverryan Oct 17, 2021
f86b086
Merge pull request #165 from weaverryan/table-indented-header
greg0ire Oct 17, 2021
f494cd0
Remove nested ifs from DocumentParser
wouterj Oct 20, 2021
bb3d9cf
Adding failing test case
weaverryan Oct 20, 2021
0875723
Making indentation stripping smarter by checking all lines
weaverryan Oct 20, 2021
c47f155
Merge pull request #168 from weaverryan/diff-highlighting
greg0ire Oct 21, 2021
73992ea
Merge pull request #167 from wouterj/documentparser-nested-if-simplif…
greg0ire Oct 21, 2021
79c8532
Merge pull request #169 from doctrine/0.4.x-merge-up-into-0.5.x_GMXPuyGS
greg0ire Oct 21, 2021
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
32 changes: 31 additions & 1 deletion .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,41 @@
"slug": "latest",
"upcoming": true
},
{
"name": "0.5",
"branchName": "0.5.x",
"slug": "0.5",
"upcoming": true
},
{
"name": "0.4",
"branchName": "0.4.x",
"slug": "0.4",
"current": true
},
{
"name": "0.3",
"branchName": "0.3.x",
"slug": "0.3",
"maintained": false
},
{
"name": "0.2",
"branchName": "0.2.x",
"slug": "0.2",
"maintained": false
},
{
"name": "0.2",
"branchName": "0.2.x",
"slug": "0.2",
"maintained": false
},
{
"name": "0.1",
"branchName": "0.1.x",
"slug": "0.1",
"current": true
"maintained": false
}
]
}
32 changes: 1 addition & 31 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Cache dependencies installed with Composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with Composer"
run: "composer install --no-interaction --no-progress --no-suggest"

# https://github.com/doctrine/.github/issues/3
- name: "Run PHP_CodeSniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@1.1.0"
87 changes: 3 additions & 84 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,87 +12,6 @@ env:
jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
deps:
- "normal"
include:
# Tests the lowest set of dependencies
- deps: "low"
php-version: "7.1"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP with XDebug"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.php-version == '7.1' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
ini-values: "zend.assertions=1"

- name: "Install PHP with PCOV"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.php-version != '7.1' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --prefer-stable"
if: "${{ matrix.deps == 'normal' }}"

- name: "Install lowest possible dependencies with composer"
run: "composer update --no-interaction --prefer-dist --prefer-lowest"
if: "${{ matrix.deps == 'low' }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.php-version }}-${{ matrix.deps }}-${{ hashFiles('composer.lock') }}.coverage"
path: "coverage.xml"

upload_coverage:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-20.04"
needs:
- "phpunit"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Download coverage files"
uses: "actions/download-artifact@v2"
with:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
with:
directory: reports
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@1.1.0"
with:
php-versions: '["7.2", "7.3", "7.4", "8.0"]'
55 changes: 7 additions & 48 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,10 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
runs-on: "ubuntu-20.04"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

# Uncomment this step if the repository uses a "next minor as default
# branch" policy.
#
# - name: "Create and/or Switch to new Release Branch"
# uses: "laminas/automatic-releases@v1"
# with:
# command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
# env:
# "GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
# "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
# "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
# "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@1.1.1"
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
ORGANIZATION_ADMIN_TOKEN: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
22 changes: 22 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Upgrade to 0.5

## Property visibility changed from protected to private

Some directives and node classes had protected visibility for their properties.
That has now been changed to private.

## Final classes by default

Many classes have been made final because they were never actually extended.

## Error handling

The `Doctrine\RST\Environment::addError()` and `Doctrine\RST\Environment::addWarning()`
have been removed.

The `Doctrine\RST\ErrorManager::error()` and `Doctrine\RST\ErrorManager::warning()`
have an updated signature to support file name and line numbers.

Method `Doctrine\RST\ErrorManager::getErrors()` will return a list of `Doctrine\RST\Error`
instead of a list of strings.

# Upgrade to 0.4

## Refactored List Rendering
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.2 || ^8.0",
"doctrine/event-manager": "^1.0",
"symfony/filesystem": "^4.1 || ^5.0",
"symfony/finder": "^4.1 || ^5.0",
"symfony/polyfill-mbstring": "^1.0",
"symfony/string": "^5.3",
"symfony/translation-contracts": "^1.1 || ^2.0",
"twig/twig": "^2.9 || ^3.3"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion lib/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use function is_dir;
use function sprintf;

class Builder
final class Builder
{
/** @var Kernel */
private $kernel;
Expand Down
2 changes: 1 addition & 1 deletion lib/Builder/Copier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use function dirname;
use function is_dir;

class Copier
final class Copier
{
/** @var Filesystem */
private $filesystem;
Expand Down
11 changes: 10 additions & 1 deletion lib/Builder/ParseQueueProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
use Doctrine\RST\Parser;

use function filemtime;
use function fwrite;
use function getenv;
use function sprintf;

class ParseQueueProcessor
use const STDERR;

final class ParseQueueProcessor
{
/** @var Kernel */
private $kernel;
Expand Down Expand Up @@ -62,6 +67,10 @@ public function process(ParseQueue $parseQueue): void

private function processFile(string $file): void
{
if (getenv('SHELL_VERBOSITY') >= 1) {
fwrite(STDERR, sprintf("Processing file: %s\n", $file));
}

$fileAbsolutePath = $this->buildFileAbsolutePath($file);

$parser = $this->createFileParser($file);
Expand Down
2 changes: 1 addition & 1 deletion lib/Builder/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function strlen;
use function substr;

class Scanner
final class Scanner
{
/** @var string */
private $fileExtension;
Expand Down
23 changes: 22 additions & 1 deletion lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

class Configuration
{
public const THEME_DEFAULT = 'default';
public const THEME_DEFAULT = 'default';
public const OUTPUT_FORMAT_CONSOLE = 'console';
public const OUTPUT_FORMAT_GITHUB = 'github';

/** @var string */
private $cacheDir;
Expand All @@ -53,6 +55,9 @@ class Configuration
/** @var bool */
private $warningsAsError = false;

/** @psalm-var self::OUTPUT_FORMAT_* */
private $outputFormat = self::OUTPUT_FORMAT_CONSOLE;

/** @var bool */
private $ignoreInvalidReferences = false;

Expand Down Expand Up @@ -227,6 +232,22 @@ public function isWarningsAsError(): bool
return $this->warningsAsError;
}

/**
* @psalm-return self::OUTPUT_FORMAT_*
*/
final public function getOutputFormat(): string
{
return $this->outputFormat;
}

/**
* @psalm-param self::OUTPUT_FORMAT_* $outputFormat
*/
final public function setOutputFormat(string $outputFormat): void
{
$this->outputFormat = $outputFormat;
}

public function getIgnoreInvalidReferences(): bool
{
return $this->ignoreInvalidReferences;
Expand Down
2 changes: 1 addition & 1 deletion lib/Directives/CodeBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* echo "Hello world!\n";
*/
class CodeBlock extends Directive
final class CodeBlock extends Directive
{
public function getName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Directives/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\RST\Nodes\Node;
use Doctrine\RST\Parser;

class Dummy extends Directive
final class Dummy extends Directive
{
public function getName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Directives/Raw.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* <u>Undelined!</u>
*/
class Raw extends Directive
final class Raw extends Directive
{
public function getName(): string
{
Expand Down
Loading