Git Product home page Git Product logo

Comments (7)

freckletonj avatar freckletonj commented on August 11, 2024 6

Emacs lock files endlessly trigger test runs. Autosaves are less frequent but still thorny. It would be nice if pytest-watch could respect .gitignore or custom regex/globs, eg: \#*\# and .\#*.

from pytest-watch.

TauPan avatar TauPan commented on August 11, 2024

This hurts me, too. In addition, emacs will create auto-saves and lockfiles in the current directory by default.

@JohnBloom as a workaround, you could try override flycheck for python (I'm using elpy) to use flymake-create-temp-with-folder-structure instead of flymake-create-temp-inplace. I'm using the following, which is quite a mouthful, so a little help from pytest-watch would be much appreciated:

(defun elpy-flymake-python-init ()
  ;; Make sure it's not a remote buffer as flymake would not work
  (when (not (file-remote-p buffer-file-name))
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-with-folder-structure)))
      (list python-check-command
            (list temp-file)
            ;; Run flake8 from / to avoid import problems (#169)
            "/"))))

;;---- from https://www.emacswiki.org/emacs/BackupDirectory
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))
(message "Deleting old backup files...")
(let ((week (* 60 60 24 7))
      (current (float-time (current-time))))
  (dolist (file (directory-files temporary-file-directory t))
    (when (and (backup-file-name-p file)
               (> (- current (float-time (fifth (file-attributes file))))
                  week))
      (message "%s" file)
      (delete-file file))))
;;----
(setq create-lockfiles nil)
;;----

from pytest-watch.

Rovanion avatar Rovanion commented on August 11, 2024

Sadly, on my machine at least, it seems like the above Emacs config makes flake8 lose track of the .flake8 files in the project structure and thus which rules it should or shouldn't apply.

from pytest-watch.

kontsaki avatar kontsaki commented on August 11, 2024

for linux users as a replacement for pytest-watch you can use the entr command which is an interface to inotify and feed it whatever files you want through fdfind / find etc.

from pytest-watch.

leotrs avatar leotrs commented on August 11, 2024

Also having this problem

from pytest-watch.

KMontag42 avatar KMontag42 commented on August 11, 2024

bump

from pytest-watch.

space-nuko avatar space-nuko commented on August 11, 2024

Also had this problem, with flycheck specifically

from pytest-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.