Skip to content

Fix annotations in file note functions #1220

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

newhoggy
Copy link
Contributor

Changelog

- description: |
    Fix annotations in file note functions
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

The annotations were incorrect in the case of absolute file paths. Absolute file paths should not be prepended to.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@newhoggy newhoggy marked this pull request as ready for review June 14, 2025 09:52
@newhoggy newhoggy force-pushed the newhoggy/fix-annotations-in-file-note-functions branch from 065dd97 to c2b17d0 Compare June 14, 2025 10:00
Comment on lines +261 to +263
if isAbsolute filePath
then H.annotate filePath
else H.annotate $ cardanoCliPath </> filePath
Copy link
Contributor

Choose a reason for hiding this comment

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

The check is redundant when using </>

Suggested change
if isAbsolute filePath
then H.annotate filePath
else H.annotate $ cardanoCliPath </> filePath
H.annotate $ cardanoCliPath </> filePath

Comment on lines +269 to +277
if isAbsolute filePath
then H.note filePath
else do
let tempWithFilePath = tempDir </> filePath
if isAbsolute tempWithFilePath
then H.note tempWithFilePath
else do
H.annotate $ cardanoCliPath </> tempWithFilePath
return tempWithFilePath
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we annotating absolute paths, but returning a relative one only in this place? What issue does this function solve?

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

isAbsolute seems unnecessary

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