Skip to content

Issue #17449: Add XDoc examples for MethodNameCheck properties#17844

Merged
romani merged 1 commit into
checkstyle:masterfrom
Hariom-kr:XDoc
Oct 1, 2025
Merged

Issue #17449: Add XDoc examples for MethodNameCheck properties#17844
romani merged 1 commit into
checkstyle:masterfrom
Hariom-kr:XDoc

Conversation

@Hariom-kr

@Hariom-kr Hariom-kr commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

#17449
Added missing XDoc examples for MethodNameCheck:

  • Example 6: applyToPrivate
  • Example 7: applyToPackage
  • Updated the XDoc template file to include references to these examples.
  • Added MethodNameCheckExamplesTest to verify the examples.

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Hi @romani, the PR is ready.

@romani

romani commented Sep 29, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@github-actions

Copy link
Copy Markdown
Contributor

@romani

romani commented Sep 30, 2025

Copy link
Copy Markdown
Member

https://github.com/checkstyle/checkstyle/wiki/How-to-run-certain-phases-and-validations#how-to-generate-website-only

Please validate how website will looks like after update.
You need to update ExampleTest class to run your test and update template file for xml to put your files in xdoc files to later plugin put in html

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Okay, got it.

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

sry,methodname.xml left i am updating it now

@romani

romani commented Sep 30, 2025

Copy link
Copy Markdown
Member

Update template file and just run tests, they will update final xml file thy will be used in html generation

@Hariom-kr Hariom-kr force-pushed the XDoc branch 4 times, most recently from 5219af6 to 36f0b04 Compare September 30, 2025 16:21
@Hariom-kr Hariom-kr force-pushed the XDoc branch 2 times, most recently from 13e050a to e539988 Compare September 30, 2025 18:38
@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Github, generate website

@romani

romani commented Oct 1, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

@romani

romani commented Oct 1, 2025

Copy link
Copy Markdown
Member

Updates should be at

<subsection name="Examples" id="MethodName_Examples">
this section.
Try to follow a pattern.

After update run mvnw clean test it will update https://github.com/checkstyle/checkstyle/blob/master/src/site/xdoc/checks/naming/methodname.xml

After that run command to build website on local

@Hariom-kr Hariom-kr force-pushed the XDoc branch 2 times, most recently from 3789a35 to 44c45c3 Compare October 1, 2025 09:51
@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Updated template file, runned the test locally and site is generated

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Github, generate website

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

last

public void Method1() {} // violation 'Name 'Method1' must match pattern'
protected void Method2() {} // violation 'Name 'Method2' must match pattern'
private void Method3() {} // violation 'Name 'Method3' must match pattern'
void Method4() {} // ok, package-private methods ignored

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please remove "ok" comment, no comment means all is ok.

same for other Example.

@romani

romani commented Oct 1, 2025

Copy link
Copy Markdown
Member

@Hariom-kr, please create one more PR for some other Check to make sure you fully onboarded on how to our Examples works and web site is working.

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

Github, generate website

@Hariom-kr

Copy link
Copy Markdown
Contributor Author

@Hariom-kr, please create one more PR for some other Check to make sure you fully onboarded on how to our Examples works and web site is working.

Okay, sure I’ll create another PR with examples for a different Check .

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome.

Thanks a lot!!

@romani romani merged commit 850ef33 into checkstyle:master Oct 1, 2025
120 checks passed
@Hariom-kr Hariom-kr deleted the XDoc branch October 6, 2025 09:35
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.

2 participants