Skip to content

feat(#553): add test-word lint - #1237

Open
VasilevNStas wants to merge 1 commit into
objectionary:masterfrom
VasilevNStas:fix/issue-553-test-word
Open

feat(#553): add test-word lint#1237
VasilevNStas wants to merge 1 commit into
objectionary:masterfrom
VasilevNStas:fix/issue-553-test-word

Conversation

@VasilevNStas

Copy link
Copy Markdown
Contributor

Fixes #553.

Problem

Objects with names containing the word test (case-insensitive) are allowed, while the project convention requires test names to be clean. Such names should lead to lint warnings.

Solution / What

New XSLT lint test-word that warns when an object name contains test in a test context: object names inside test objects (matched by the eo:test-name() helper), their ancestors, or when the top-level object name ends with -tests.

Changes

  • src/main/resources/org/eolang/lints/tests/test-word.xsl — the new lint.
  • src/main/resources/org/eolang/motives/tests/test-word.md — motivation.
  • src/test/resources/org/eolang/lints/packs/single/test-word/ — 5 test packs.

Tests

  • catches-test-in-test-object
  • catches-test-word-in-helper
  • catches-test-in-nested-object
  • allows-clean-test-names
  • allows-test-word-in-regular-object

@VasilevNStas

Copy link
Copy Markdown
Contributor Author

@volodya-lombrozo please review, I`m fixed it

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.

test attributes with name containing "test" are possible, while should lead to lint warnings

1 participant