Comments (17)
@gracjan I disagree. Closing as “wontfix”, for this is a feature, not a bug.
The GHC settings are empty by default, so normally Flycheck will only use the Cabal settings. But if they aren't empty, i.e. if the user explicitly added additional settings, changes are, that the user really wants to use these additional settings, for whatever reason, and we should never ignore or overwrite explicit settings made by the user.
And again, this is not Cabal, and I do not intend to mimic Cabal as closely as possible. That is way to complicated, and essentially just a duplication of what cabal build
already does. Hence, #8. That's the way to go, not making this extension more and more complicated by putting more and more cabal settings into it. That's not going to happen.
from flycheck-haskell.
@gracjan The user package database flag is still there, but it's only set if building inside a sandbox.
from flycheck-haskell.
Running (flycheck-haskell-configure) twice appends all the flags twice.
At least make it append to the defaults not to current buffer local values.
Also my project disagrees with you. It flychecks perfectly when running
with options set, does not flycheck when using some inconsistent mash up of
flags sourced from here and there.
2014-06-04 11:20 GMT+02:00 Sebastian Wiesner [email protected]:
@gracjan https://github.com/gracjan The user package database flag is
still there, but it's only set if building inside a sandbox.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
from flycheck-haskell.
@gracjan GHC options don't appear magically from outer space. If you have additional GHC options, that did not come from this extension, then it's only because you explicitly added these options somewhere, e.g. in your init.el
or via local variables.
Duplicating flags won't do no harm. I agree, though, that we need to remove old values in flycheck-haskell-configure
. But that's a separate issue.
from flycheck-haskell.
flycheck-ghc-xxxx serve a very nice purpose when flychecking Haskell source
files that are not part of cabal project. In case of flychecking source
files under cabal project they cause issues.
Example:
Global package db set in flycheck-ghc-package-db to ("~/my-package-db")
contains package called "monads-tf-1.2.3".
Cabal project explicitly asks to use only local sandbox packages. Local
sandbox contains "monads-tf-4.5.6".
Since local sandbox is appended to package db list then packages will be
picked from global package db defined in global flycheck-ghc-options.
Conflict! No compilation.
2014-06-04 11:36 GMT+02:00 Sebastian Wiesner [email protected]:
@gracjan https://github.com/gracjan GHC options don't appear magically
from outer space. If you have additional GHC options, that did not come
from this extension, then it's only because you explicitly added these
options somewhere, e.g. in your init.el or via local variables.Duplicating flags won't do no harm. I agree, though, that we need to
remove old values in flycheck-haskell-configure. But that's a separate
issue.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
from flycheck-haskell.
@gracjan That's a configuration error. You should not set flycheck-ghc-package-db
globally.
from flycheck-haskell.
Yyyy?
M-x customize flycheck-ghc-package-databases
?
What's not global about this?
Also: flycheck-ghc-package-databases was an example. All other options
cause very similar issues.
2014-06-04 12:51 GMT+02:00 Sebastian Wiesner [email protected]:
@gracjan https://github.com/gracjan That's a configuration error. You
should not set flycheck-ghc-package-db globally.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
from flycheck-haskell.
@gracjan M-x customize
sets variables globally. These should affect all buffers. That is the standard semantics of M-x customize
, and that is what most users will expect. No package should programatically overwrite these settings.
If you don't want that, don't use M-x customize
to set Flycheck's variables. They are buffer-local for a reason: Use a hook to set them for some buffers only, or use file- or dir-local variables to set them just from some files or projects respectively. That is, what Flycheck recommends you to do:
[…] Options are mainly intended to be used […] via File or Directory Local variables. See File Variables(emacs) and Directory Variables(emacs) respectively.
In other words, you should not change these options via M-x customize
(or with setq-default
), unless you really want to have them in all buffers. In this case, you obviously don't want it, so don't use M-x customize
.
from flycheck-haskell.
I did not know about file-local or directory-local variables.
My point still stands: flycheck-haskell-configure should append to
original values of variables, not cumulative append as it does now.
I have no idea where to get original value once it has been set by
flycheck-haskell-configure.
2014-06-04 16:01 GMT+02:00 Sebastian Wiesner [email protected]:
@gracjan https://github.com/gracjan M-x customize sets variables
globally. These should affect all buffers. That is the standard
semantics of M-x customize, and that is what most users will expect. No
package should programatically overwrite these settings.If you don't want that, don't use M-x customize to set Flycheck's
variables. They are buffer-local for a reason: Use a hook to set them for
some buffers only, or use file- or dir-local variables to set them just
from some files or projects respectively. That is, what Flycheck recommends
you to do
http://flycheck.readthedocs.org/en/latest/guide/usage.html#syntax-checker-options
:[…] Options are mainly intended to be used […] via File or Directory
Local variables. See File Variables(emacs) and Directory Variables(emacs)
respectively.In other words, you should not change these options via M-x customize (or
with setq-default), unless you really want to have them in all buffers.
In this case, you obviously don't want it, so don't use M-x customize.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
from flycheck-haskell.
Well, local variables are an essential part of Emacs, especially Directory Local Variables. They provide a convenient and simple way to have project-specific settings.
from flycheck-haskell.
As for flycheck-haskell-configure
, I agree that it should be fixed. Could you please make me a separate issue for that, lest I forget?
from flycheck-haskell.
Thinking about this one a bit more I reckon that I have Directory Local Variables in my xxxx.cabal file (instead of emacs specific things) and my File Local Variables in the form of {-# ... #-} (instead of emacs specific). It is a shame to treat them in a different way than those in emacs specific files.
from flycheck-haskell.
@gracjan I'm sorry, but I can't follow you on your last comment…
from flycheck-haskell.
Might be language issue, but by 'follow' do you mean that you do not understand or do you mean that you disagree?
from flycheck-haskell.
The former.
from flycheck-haskell.
In equations:
my-project.cabal === .dir-locals.el
{-# OPTIONS_GHC .... #-} === -- mode: haskell --
Just like settings from .dir-locals.el overwrite previously set variables so should settings from my-project.cabal overwrite (NOT append to) settings set previously.
from flycheck-haskell.
@gracjan I'm still not getting what you are trying to tell me.
from flycheck-haskell.
Related Issues (20)
- flycheck-disable-checked not disabling haskell-stack-ghci HOT 6
- `flycheck-haskell-setup` signals error on Windows HOT 4
- Support for Haskell scripts made with Stack HOT 1
- Using flycheck in a docker-based stack project? HOT 1
- Bug in get-cabal-configuration.hs HOT 2
- call to stack / get-cabal-configuration delays editing file HOT 2
- IO mzero error when reading cabal configuration HOT 2
- cabal new-style builds HOT 1
- running hlint when installed using --copy-compiler-bins HOT 2
- Module ‘Distribution.PackageDescription.Parsec’ does not export ‘readGenericPackageDescription’
- Very bad performance HOT 4
- no errors HOT 7
- Paths_* modules cannot be found HOT 11
- Support hpack files directly HOT 3
- Flycheck with nix: Could not find module HOT 4
- Flycheck-haskell hangs indefinitely on NixOS HOT 6
- weird output from haskell-hlint checker HOT 2
- Support for cabal.project? HOT 1
- flycheck-haskell is very slow when stack.yaml is not pressent HOT 10
- Reference to Distribution.Parsec.Common needs to be updated for Cabal-3.0.0.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flycheck-haskell.