<commit_before>;;; base-projects.el --- Project configuration -*- lexical-binding: t; -*-

;;; Commentary:
;; Project management.

;;; Code:

(eval-when-compile
  (require 'base-vars)
  (require 'base-package))

;;;
;; Packages

(req-package projectile
  :demand t
  :diminish projectile-mode
  :hook (find-file . +projectile-relative-buf-name)
  :preface
  (defun +projectile-relative-buf-name ()
    (let ((buffer-name (if (projectile-project-p)
                           (file-relative-name buffer-file-name (projectile-project-root))
                         (abbreviate-file-name buffer-file-name))))
      (rename-buffer buffer-name)))
  :init
  (setq projectile-cache-file (concat my-cache-dir "projectile.cache")
        projectile-enable-caching nil
        projectile-file-exists-remote-cache-expire nil
        projectile-globally-ignored-file-suffixes
        '(".elc" ".pyc" ".o" ".hi" ".class" ".cache")
        projectile-globally-ignored-files
        '("TAGS" "GPATH" "GRTAGS" "GTAGS")
        projectile-indexing-method 'alien
        projectile-ignored-projects (list my-data-dir)
        projectile-known-projects-file (concat my-data-dir "projectile.projects"))
  :config
  (defun +projectile-cache-current-file (orig-fun &rest args)
    "Don't cache ignored files."
    (unless (cl-some (lambda (path)
                       (string-prefix-p buffer-file-name
                                        (expand-file-name path)))
                     (projectile-ignored-directories))
      (apply orig-fun args)))
  (advice-add #'projectile-cache-current-file :around #'+projectile-cache-current-file)

  (setq projectile-globally-ignored-directories
        (append '("_build"
                  "target" "project/target"
                  "vendor/bundle" "vendor/cache"
                  "elm-stuff" "tests/elm-stuff")
                projectile-globally-ignored-directories))

  (setq projectile-project-root-files
        (append '("package.json" "Package.swift" "README.md")
                projectile-project-root-files))
  (setq projectile-other-file-alist
        (append '(("less" "css")
                  ("styl" "css")
                  ("sass" "css")
                  ("scss" "css")
                  ("css" "scss" "sass" "less" "styl")
                  ("jade" "html")
                  ("pug" "html")
                  ("html" "jade" "pug" "jsx" "tsx"))
                projectile-other-file-alist))

  (projectile-mode 1))

(req-package direnv
  :defer 2
  :config
  (set-popup-buffer (rx bos " *direnv*" eos))
  (direnv-mode))<commit_msg>base: don't display output on auto direnv<commit_after>;;; base-projects.el --- Project configuration -*- lexical-binding: t; -*-

;;; Commentary:
;; Project management.

;;; Code:

(eval-when-compile
  (require 'base-vars)
  (require 'base-package))

;;;
;; Packages

(req-package projectile
  :demand t
  :diminish projectile-mode
  :hook (find-file . +projectile-relative-buf-name)
  :preface
  (defun +projectile-relative-buf-name ()
    (let ((buffer-name (if (projectile-project-p)
                           (file-relative-name buffer-file-name (projectile-project-root))
                         (abbreviate-file-name buffer-file-name))))
      (rename-buffer buffer-name)))
  :init
  (setq projectile-cache-file (concat my-cache-dir "projectile.cache")
        projectile-enable-caching nil
        projectile-file-exists-remote-cache-expire nil
        projectile-globally-ignored-file-suffixes
        '(".elc" ".pyc" ".o" ".hi" ".class" ".cache")
        projectile-globally-ignored-files
        '("TAGS" "GPATH" "GRTAGS" "GTAGS")
        projectile-indexing-method 'alien
        projectile-ignored-projects (list my-data-dir)
        projectile-known-projects-file (concat my-data-dir "projectile.projects"))
  :config
  (defun +projectile-cache-current-file (orig-fun &rest args)
    "Don't cache ignored files."
    (unless (cl-some (lambda (path)
                       (string-prefix-p buffer-file-name
                                        (expand-file-name path)))
                     (projectile-ignored-directories))
      (apply orig-fun args)))
  (advice-add #'projectile-cache-current-file :around #'+projectile-cache-current-file)

  (setq projectile-globally-ignored-directories
        (append '("_build"
                  "target" "project/target"
                  "vendor/bundle" "vendor/cache"
                  "elm-stuff" "tests/elm-stuff")
                projectile-globally-ignored-directories))

  (setq projectile-project-root-files
        (append '("package.json" "Package.swift" "README.md")
                projectile-project-root-files))
  (setq projectile-other-file-alist
        (append '(("less" "css")
                  ("styl" "css")
                  ("sass" "css")
                  ("scss" "css")
                  ("css" "scss" "sass" "less" "styl")
                  ("jade" "html")
                  ("pug" "html")
                  ("html" "jade" "pug" "jsx" "tsx"))
                projectile-other-file-alist))

  (projectile-mode 1))

(req-package direnv
  :defer 2
  :init
  (setq direnv-always-show-summary nil)
  :config
  (set-popup-buffer (rx bos " *direnv*" eos))
  (direnv-mode))
{'fraction_non_alphanumeric': 0.1496937212863706, 'fraction_numerical': 0.0007656967840735069, 'mean_word_length': 2.125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2186567', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1644, 'n_words': 315}