Function: projectile-parse-dirconfig-file

projectile-parse-dirconfig-file is a byte-compiled function defined in projectile.el.

Signature

(projectile-parse-dirconfig-file)

Documentation

Parse project ignore file and return directories to ignore and keep.

The return value will be a list of three elements, the car being the list of directories to keep, the cadr being the list of files or directories to ignore, and the caddr being the list of files or directories to ensure.

Strings starting with + will be added to the list of directories to keep, and strings starting with - will be added to the list of directories to ignore. For backward compatibility, without a prefix the string will be assumed to be an ignore string.

Results are cached per project root and invalidated when the dirconfig file's modification time changes.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile-parse-dirconfig-file ()
  "Parse project ignore file and return directories to ignore and keep.

The return value will be a list of three elements, the car being
the list of directories to keep, the cadr being the list of files
or directories to ignore, and the caddr being the list of files
or directories to ensure.

Strings starting with + will be added to the list of directories
to keep, and strings starting with - will be added to the list of
directories to ignore.  For backward compatibility, without a
prefix the string will be assumed to be an ignore string.

Results are cached per project root and invalidated when the
dirconfig file's modification time changes."
  (let* ((dirconfig (projectile-dirconfig-file))
         (project-root (projectile-project-root))
         (cached (gethash project-root projectile--dirconfig-cache))
         (attrs (file-attributes dirconfig))
         (mtime (when attrs (file-attribute-modification-time attrs))))
    (if (and cached mtime (equal (car cached) mtime))
        (cdr cached)
      (let ((result (projectile--parse-dirconfig-file-uncached)))
        (when mtime
          (puthash project-root (cons mtime result) projectile--dirconfig-cache))
        result))))