Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete contributing guide #2165

Merged
merged 7 commits into from
Sep 8, 2021
Merged

Complete contributing guide #2165

merged 7 commits into from
Sep 8, 2021

Conversation

jneira
Copy link
Member

@jneira jneira commented Sep 7, 2021

  • with the contents of ./CONTRIBUTING.md (mainly the pre commit hook to format)

With the contents of ./CONTRIBUTING.md (mainly the pre commit hook to format)
Included in the main documentation
As building and testing are more important imo
Copy link
Member

@Ailrun Ailrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update!

"hooks": [
{
"entry": "stylish-haskell --inplace",
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we need to update this regex to include up-to-date "excludes" setting in nix config. The current Nix config ignores more files than these.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$)",
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/test/exe/Main.hs$|ghcide/src/Development/IDE/Core/Rules.hs|^hls-test-utils/src/Test/Hls/Util.hs$)",

that would be correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow i did not apply this commit 🤦

docs/contributing/contributing.md Outdated Show resolved Hide resolved
docs/contributing/contributing.md Outdated Show resolved Hide resolved
jneira and others added 2 commits September 7, 2021 08:32
Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
Co-Authored-By: jhrcek
@jneira jneira added the merge me Label to trigger pull request merge label Sep 7, 2021
Copy link
Collaborator

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM

@mergify mergify bot merged commit d1d7ce0 into master Sep 8, 2021
Comment on lines +107 to +110
An alternative, which only recompiles when tests (or dependencies) change:

```bash
$ cabal run haskell-language-server:func-test -- -p "hlint enables"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works. It will use the HLS binary in your path, not the development build

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems this can make it not use the PATH one:

build-tool-depends:
haskell-language-server:haskell-language-server -any,
ghcide:ghcide-test-preprocessor -any

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that won't help. cabal run does not change the environment, as far as I know.
You can do cabal exec cabal run h-l-s:func-test -- -- -p ... and it will work sometimes

Copy link
Member Author

@jneira jneira Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that won't help. cabal run does not change the environment, as far as I know.

It seems so: haskell/cabal#5411 (comment). It works for cabal test but no for cabal run iiuic that comment

You can do cabal exec cabal run h-l-s:func-test -- -- -p ... and it will work sometimes

It works enough times to update the instructions? are you are referring to the fact cabal exec will not rebuild the executable and you could end using a older version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover with cabal-install-3.8, test arguments will not trigger a rebuild

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe cabal exec does trigger a rebuild, but it fails with weird errors in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants