f.el icon indicating copy to clipboard operation
f.el copied to clipboard

Add `f-presence`, `f-presence-directory`, `f-presence-file`, `f-presence-symlink`, and `f-presence-readable`

Open sylvorg opened this issue 2 years ago • 5 comments

The same as the previous pull request, but hopefully with everything rebased and merged properly:

Add functions to return path when path exists, is a file, is a directory, is a symlink, or is readable, similar to s-presence from Magnar's s.el.

This should be useful in situations such as (cond), where you might want to see if a file, directory, symlink, etc. exists before returning it, all in one go.

sylvorg avatar Nov 27 '23 02:11 sylvorg

Hi, sorry for the delayed response. Your code looks good to me, I just need you to do two things before I can merge this PR:

  1. Squash your commits into one. You should be able to do this with the command git reset --soft HEAD~5. You can also do a git rebase -i HEAD~5 if you prefer to.
  2. Then you should be able to commit again to modify your commit message. As mentioned in [CONTRIBUTING.org] (https://github.com/rejeep/f.el/blob/master/CONTRIBUTING.org#git-commit-messages), your commit messages should not contain lines longer than 72 characters. As you can see, your commit message gets truncated here. Something like Add \f-presence` and related functions` ought to do the job, and you could mention the other functions in the body of your commit.

In the meantime, I’ll run the workflow to check your workflow to verify if everything checks out.

Phundrak avatar Dec 12 '23 12:12 Phundrak

No worries, and I think that should do the trick! Just let me know if you need anything else!

sylvorg avatar Dec 12 '23 16:12 sylvorg

Regarding the latest CI run:

Huh... Well that's disappointing... What happened?

sylvorg avatar Dec 19 '23 18:12 sylvorg

Running the tests locally, it seems like they either are incorrect, the function they are supposed to be testing is incorrect, or they contain syntax errors.

Ran 261 tests in 0.728 seconds
10 unexpected results:
   FAILED  f-presence-directory/directory-paths
   FAILED  f-presence-directory/non-directory-paths
   FAILED  f-presence-file/file-paths
   FAILED  f-presence-file/non-file-paths
   FAILED  f-presence-readable/readable-paths
   FAILED  f-presence-readable/unreadable-paths
   FAILED  f-presence-symlink/non-symlink-paths
   FAILED  f-presence-symlink/symlink-paths
   FAILED  f-presence/existent-paths
   FAILED  f-presence/nonexistent-paths
make[1]: *** [Makefile:14: unit] Error 1
make[1]: Leaving directory '/home/phundrak/.config/emacs/straight/repos/f.el'
make: *** [Makefile:8: test] Error 2

Please make sure you run make test (after make install-deps if necessary) and that all tests pass.

Phundrak avatar Jan 05 '24 18:01 Phundrak