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

Stops empty ToC block appearing when no headings to link to are found. #40

Merged
merged 5 commits into from
Mar 22, 2023

Conversation

rupertj
Copy link
Member

@rupertj rupertj commented Mar 21, 2023

Fixes #37.

Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we've not got the default github workflows tests running yet, so worth running phpcs locally.

Just did and there are a few coding standards things to fix:

finn@Oobuntoo:~/sites/l.localgov/MY_PROJECT$ lando phpcs web/modules/contrib/localgov_publications/
............................................EE...W.E.. 54 / 54 (100%)



FILE: ...les/contrib/localgov_publications/localgov_publications.info.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 14 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...trib/localgov_publications/tests/src/Functional/TocBlockTest.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 33 | ERROR | [x] Missing function doc comment
 48 | ERROR | [x] There must be exactly one blank line before the
    |       |     tags in a doc comment
 74 | ERROR | [x] Expected 1 blank line after function; 0 found
 75 | ERROR | [x] The closing brace for the class must have an empty
    |       |     line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...dules/contrib/localgov_publications/localgov_publications.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 44 | WARNING | Line exceeds 80 characters; contains 82 characters
----------------------------------------------------------------------


FILE: ...ules/contrib/localgov_publications/localgov_publications.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 801ms; Memory: 12MB

tests/src/Functional/TocBlockTest.php Show resolved Hide resolved
@finnlewis
Copy link
Member

The block visibility does work though, so thanks, for this! 😺

@rupertj
Copy link
Member Author

rupertj commented Mar 22, 2023

I've merged 1.x in here with the proper CI pipeline setup, so we should see the tests pass in a bit...

Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @rupertj 😄

@rupertj rupertj merged commit 634e738 into 1.x Mar 22, 2023
@rupertj rupertj deleted the fix/1.x/37-on-this-page-display-no-links branch March 22, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On this page title displays even if no links
2 participants