Skip to content

Comments

Remove unused code from test_extractor.d#403

Merged
dlang-bot merged 1 commit intodlang:masterfrom
MoonlightSentinel:simplify
Jun 25, 2020
Merged

Remove unused code from test_extractor.d#403
dlang-bot merged 1 commit intodlang:masterfrom
MoonlightSentinel:simplify

Conversation

@MoonlightSentinel
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel commented May 3, 2020

hasDdocHeader was only called if decl.unittest_ wasn't null and
hence only executed the first if-branch.

The remainder of that method is obsolete because dparse sets comment
even for empty ddoc comments (see dlang-community/libdparse#401).

Relying on dparse also removes some false positives/negatives, e.g.

///
// Some comment
unittest {} // Ignored

////////////////////////////////////////////////////////////////////////////////
// Unit Tests
////////////////////////////////////////////////////////////////////////////////

unittest {} // Extracted

Note: This can be merged once dparse tags a new release containing the aforementioned PR.

@PetarKirov
Copy link
Member

Nice!

@Geod24 Geod24 added the PR.Blocked A PR blocker by another issue / PR, external to the PR (as opposed to WIP) label May 18, 2020
`hasDdocHeader` was only called if `decl.unittest_` wasn't null and
hence only executed the first if-branch.

The remainder of that method is obsolete because dparse sets `comment`
even for empty ddoc comments (see dlang-community/libdparse#401).

Relying on dparse also removes some false positives/negatives, e.g.

```
///
// Some comment
unittest {} // Ignored

////////////////////////////////////////////////////////////////////////////////
// Unit Tests
////////////////////////////////////////////////////////////////////////////////

unittest {} // Extracted
```
@MoonlightSentinel MoonlightSentinel removed the PR.Blocked A PR blocker by another issue / PR, external to the PR (as opposed to WIP) label Jun 24, 2020
@MoonlightSentinel
Copy link
Contributor Author

Finally ready

@MoonlightSentinel MoonlightSentinel marked this pull request as ready for review June 24, 2020 21:43
@dlang-bot dlang-bot merged commit 98ac196 into dlang:master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants