Repository navigation
[#411] Ended every console, log and exception message with a period and quoted interpolated values. - #415
Conversation
…nd wrapped interpolated values in double quotes.
|
Warning Review limit reached
This review includes 16 billable files and costs up to $4.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 8 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Your 84 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (16)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 97.16% 97.71% +0.54%
==========================================
Files 6 6
Lines 530 526 -4
==========================================
- Hits 515 514 -1
+ Misses 15 12 -3 ☔ View full report in Codecov by Harness. |
Closes #411
Summary
Console lines (
writeln()), log entries ($this->logger->*()) and exception messages that read as a sentence now end with a period, and every interpolated value in them is wrapped in double quotes, with each item of a list quoted on its own (Allowed modes are: "force-push", "branch".). That's the form Symfony Console's own messages already use (The "--foo" option does not exist.). The convention coversArtifactCommand,ArtifactGitRepository,FilesystemTrait,LoggerTraitandBranchNotFoundException, andCLAUDE.mdstates it under Code Standards.FilesystemTrait::fsRealpath()also puts the original symlink path into itsCould not resolve symlink for path:error.The messages followed no single rule. A successful run printed
Pushed branch "x" with commit message "y"without a period whileArtifact packaged successfully.had one, and a--branchvalue that failed validation printedIncorrect value "x" specified for git remote branchwith the value quoted while an invalid remote printedInvalid remote URL provided: git://user/repowith the value bare. Separately,fsRealpath()assigned the return value ofreadlink()straight back to$path, so whenreadlink()returnedFALSEtheCould not resolve symlink for path:exception was built from the overwritten$pathand printed nothing after the colon, and the!$pathcheck also rejected a symlink whose target is the string0.After merge, a successful run prints
Pushed branch "artifact" with commit message "Deployment commit"., and a CI grep for an old string still matches wherever the old string is a prefix of the new one, which is every changed message except those whose value gained quotes, such asInvalid remote URL provided: git://user/repo. Label-value lines (Commit: <hash>,Added changes: <git output>), the info and report table rows, the-----separators with the raw.gitignoredump, and theProcessing failed with an error:heading are data and keep their form. Messages that end by appending another exception's message, such as the chainedUnable to determine source branch. Artifact packaging failed.exception, are unchanged because the inner message supplies its own period.Before / After
Console lines, log entries and exception messages, using real strings from the source:
fsRealpath()on a symlink, by whatreadlink()returns:Changes
Messages
src/Commands/ArtifactCommand.php: console lines, log entries and exceptions end with a period,Unable to load contents ofquotes the.gitignorepath, andsetMode()passes the 2 mode constants straight tosprintf()instead of imploding an array.src/Git/ArtifactGitRepository.php: theDisabling local exclude,Restoring local exclude,Removing ignored file,Removing other file,Removing sub-repository,Copying custom .gitignore fileandRestoring custom .gitignore filedebug lines, theInvalid remote URL providedandInvalid argumentexceptions, and bothUnable to determine a detachment sourcethrows follow the convention. The firstBranchNotFoundExceptionthrow ingetOriginalBranch()is collapsed onto 1 line.src/Traits/FilesystemTrait.php:fsAssertPathsExist()quotes each path in the list it reports, soa, bbecomes"a", "b".src/Traits/LoggerTrait.phpandsrc/Exception/BranchNotFoundException.php:Debug messages enabled.and the default messageUnable to determine source branch.end with a period.Symlink resolution
fsRealpath()holds the result ofreadlink()in$target, throws with the original$pathwhen$target === FALSE, and only then assigns$path = $target. The strict comparison also stops a symlink whose target is the string0from being treated as a failure. The throw sits inside@codeCoverageIgnore, so no test drives it.Tests
assertStringNotContainsString()checks keep the shorter text on purpose.GeneralTest::testDebug()gains assertions forChecking requirements.,All requirements were met.andCleaning up..ForcePushModeTest::testGitignoreCustomRemoveCommittedFiles()runs at-vvvand asserts the custom.gitignorecopy and restore lines plusRemoving ignored file "..."for 2 files.FilesystemTraitTest::testFsAssertPathsExistWithNonExistingPathStrict()is driven by a data provider covering 1 missing path, 2 missing paths and a path containing spaces.MissingBranchTestasserts the full chained messageUnable to determine source branch. Artifact packaging failed. Unable to determine a detachment source., andArtifactCommandTestasserts the fullUnable to determine the remote default branch; skipping stale cleanup for safety.text.Docs
CLAUDE.md: a bullet under Code Standards states the convention.