Giter Site home page Giter Site logo

Comments (17)

swsnr avatar swsnr commented on June 17, 2024

@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.

swsnr avatar swsnr commented on June 17, 2024

@gracjan The user package database flag is still there, but it's only set if building inside a sandbox.

from flycheck-haskell.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

@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.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

@gracjan That's a configuration error. You should not set flycheck-ghc-package-db globally.

from flycheck-haskell.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

@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.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

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.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

@gracjan I'm sorry, but I can't follow you on your last comment…

from flycheck-haskell.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

The former.

from flycheck-haskell.

gracjan avatar gracjan commented on June 17, 2024

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.

swsnr avatar swsnr commented on June 17, 2024

@gracjan I'm still not getting what you are trying to tell me.

from flycheck-haskell.

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.