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

[#367] Add Raw constructor to Source data type #379

Merged
merged 4 commits into from
Nov 6, 2019

Conversation

chshersh
Copy link
Contributor

@chshersh chshersh commented Nov 6, 2019

Resolves #367

I've tested locally and it works surprisingly! If I add the following entries to the TOML configuration file (it works even if I already have files = [ { ... } ] entry):

[[files]]
path = "src/MyLib.hs"
raw = '''
module MyLib where

myFunc :: IO ()
myFunc = putStrLn "Hello world!"
'''

[[files]]
path = "test/Doctest.hs"
raw = '''
module Main (main) where

import System.FilePath.Glob (glob)
import Test.DocTest (doctest)


main :: IO ()
main = do
    sourceFiles <- glob "src/**/*.hs"
    doctest sourceFiles
'''

I can even see the files in the TUI structure. And I verifed content after creating the project, the content is perfect 👌

Screenshot from 2019-11-06 14-29-29

Checklist:

  • Keep code style used in the changed files (see style-guide for more details).
  • Use the stylish-haskell file.
  • Update documentation (README, haddock) if required.
  • Create a new test project using summoner and check that the changes work as expected.

Hint: Add the [ci skip] text to the docs-only related commit's name, so no need to wait for CI to pass.

@chshersh chshersh added the config TOML configurations label Nov 6, 2019
@chshersh chshersh requested a review from vrom911 as a code owner November 6, 2019 11:37
@chshersh chshersh self-assigned this Nov 6, 2019
Copy link
Contributor

@hint-man hint-man bot left a comment

Choose a reason for hiding this comment

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

There is no place for me here... I will choose the truth I like.

@chshersh chshersh force-pushed the chshersh/367-Add-Raw-constructor-to-Source branch from 0ef8990 to 9c3d628 Compare November 6, 2019 11:42
Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

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

Cool! Let's add one more file into our golden full project?

Also, I have an idea about the Link constructor.. Let me know what do you think 🙂


{- | Link to external file. Generated file contains some short text and a
a give url link.
-}
Copy link
Member

Choose a reason for hiding this comment

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

Now when we have Raw, this one is unnecessary. Do you think we can get rid of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vrom911 Yes, I also got the same idea 🙂 Link constructor now becomes redundant because is a strict and less useful subset of Raw which gives more flexibility. I think it's okay to remove it now and just write a migration guide how to use Raw 🙂

Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks a lot!

@vrom911 vrom911 merged commit 74c5c29 into master Nov 6, 2019
@vrom911 vrom911 deleted the chshersh/367-Add-Raw-constructor-to-Source branch November 6, 2019 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config TOML configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Raw constructor to Source data type
2 participants