Skip to content

Ignore a trailing dot in FullFileExtension, as FileExtension does [patch] - #544

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/542-full-extension-trailing-dot
Nov 10, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/542-full-extension-trailing-dot

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #542

What changed

SemanticFilePath.FullFileExtension now drops a trailing dot before it looks for the first extension dot. FileExtension and WeakStringWithoutExtension already did this.

Path FullFileExtension before after
report. . ""
archive.tar. .tar. .tar
.bashrc. . ""
archive.tar.gz .tar.gz .tar.gz (unchanged)

I also updated the <remarks> to describe the trailing-dot rule.

Tests

  • New test SemanticFilePath_Extensions_IgnoreATrailingDot covers the three trailing-dot rows from the issue, for both absolute and relative paths. It checks FileExtension, FullFileExtension and RemoveExtension().
  • With the fix reverted, all three rows fail on FullFileExtension. With the fix in place they pass.
  • The full Semantics.Test suite passes on net10.0: 1998 passed, 14 skipped, 0 failed. Semantics.Paths builds for all its targets.

Generated by Claude Code

…tch]

report. and .bashrc. now have no full extension, and archive.tar. gives
.tar instead of .tar., so FullFileExtension agrees with FileExtension
and RemoveExtension on the same file.

Fixes #542

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5NekzZxVh2CVpGC1W
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 4f20377 into main Nov 10, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the fix/542-full-extension-trailing-dot branch November 10, 2026 23:57
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.

FullFileExtension of report. is "." (and of archive.tar. is ".tar.") while FileExtension is "", though the docs say they follow the same rules

2 participants