3

I am using Flycheck using use-package like so:

(use-package flycheck
  :ensure t
  :init
  (global-flycheck-mode))

I followed https://randstructure.wordpress.com/2015/06/21/using-emacs-flycheck-with-perl-and-perlbrew/ and tried adding the

'(flycheck-perl-include-path
(quote
("/myhomedir/myprojectdir")))

and it does not work.

Drew
  • 75,699
  • 9
  • 109
  • 225
nc.
  • 171
  • 5

2 Answers2

4
(use-package flycheck
  :ensure t
  :init (global-flycheck-mode)
  (setq flycheck-perl-include-path '("/home/your/path/lib" 
"/home/your/other/path/lib")))
nc.
  • 171
  • 5
2

You can also set include paths per project or directory. Add a directory local variable flycheck-perl-include-path with a list of directory strings. Or just create a .dir-locals.el file with

((cperl-mode
  (flycheck-perl-include-path . ("../lib/" "path/to/you/lib"))))
rajashekar
  • 121
  • 4
  • One, I think there is an extra set of outer parens that are not needed. Two, I am getting error: "Symbol’s function definition is void: flycheck-perl-include-path". Suggestions? – mpersico Aug 24 '21 at 14:34
  • I think extra parens are needed. For e.g., if your directory has multiple languages, you need to set `((cperl-mode ...) (python-mode ...))` etc... I am not sure about the symbol's def void error. – rajashekar Aug 24 '21 at 14:42
  • Ah, ok on the extra parens then. I'll have to investigate the other issue. – mpersico Aug 24 '21 at 17:37