From 265f14939f5bf365c81cad92f1714426d6739384 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 10:47:27 -0400 Subject: [PATCH 01/12] Add back whitespace workflow --- .github/workflows/whitespace.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/whitespace.yml diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml new file mode 100644 index 00000000000..cbdf9ca914c --- /dev/null +++ b/.github/workflows/whitespace.yml @@ -0,0 +1,43 @@ +name: Whitespace + +on: + pull_request: + push: + branches: ["master"] + +jobs: + whitespace: + runs-on: ubuntu-latest + + env: + fix-whitespace-ver: '0.1' + + steps: + - uses: actions/checkout@v4 + + - name: Create directory for binary + run: | + mkdir -p $HOME/.local/bin + + - uses: actions/cache@v3 + name: Cache the binary + id: cache + with: + path: "~/.local/bin" + key: fix-whitespace-${{ env.fix-whitespace-ver }} + + - uses: haskell-actions/setup@v2 + if: ${{ !steps.cache.outputs.cache-hit }} + with: + ghc-version: '9.8' + cabal-version: latest + + - name: Install fix-whitespace + if: ${{ !steps.cache.outputs.cache-hit }} + run: | + cabal install --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }} + strip $HOME/.local/bin/fix-whitespace + + - name: Check Whitespace Conformance + run: | + $HOME/.local/bin/fix-whitespace --check From 7c9346bfabf272346d2e4930718143eee8364af4 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 10:41:40 -0400 Subject: [PATCH 02/12] Whitespace conventions in contributing --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b2cc23cb27..abfddd7715d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,7 +163,12 @@ the code base. * `make style-modified` - Format files modified in the current tree. * `make style-commit COMMIT=` - Format files modified between HEAD and the given reference. +Whitespace Conventions +---------------------- +We use automated whitespace convention checking. Violations can be fixed by +running [fix-whitespace](https://hackage.haskell.org/package/fix-whitespace). If +you push a fix of a whitespace violation, please do so in a _separate commit_. Other Conventions ----------------- From c31ca12e97e5ddbe0808d05cef94bbcf72ed570a Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 11:00:28 -0400 Subject: [PATCH 03/12] Fix whitespace in workflows --- .github/workflows/bootstrap.skip.yml | 2 +- .github/workflows/validate.skip.yml | 2 +- .github/workflows/validate.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bootstrap.skip.yml b/.github/workflows/bootstrap.skip.yml index 4a92ddaa0c6..3a47870b533 100644 --- a/.github/workflows/bootstrap.skip.yml +++ b/.github/workflows/bootstrap.skip.yml @@ -6,7 +6,7 @@ name: Bootstrap Skip # to the docs, since these jobs take a long time to complete without providing any benefit. # We therefore use path-filtering in the workflow triggers for the bootstrap jobs, namely # "paths-ignore: doc/**". But the "Bootstrap post job" is a required job, therefore a PR cannot -# be merged unless the "Bootstrap post job" completes succesfully, which it doesn't do if we +# be merged unless the "Bootstrap post job" completes succesfully, which it doesn't do if we # filter it out. # # The solution: We use a second job with the same name which always returns the exit code 0. diff --git a/.github/workflows/validate.skip.yml b/.github/workflows/validate.skip.yml index e5cd47e284a..af608e92d49 100644 --- a/.github/workflows/validate.skip.yml +++ b/.github/workflows/validate.skip.yml @@ -6,7 +6,7 @@ name: Validate Skip # to the docs, since these jobs take a long time to complete without providing any benefit. # We therefore use path-filtering in the workflow triggers for the validate jobs, namely # "paths-ignore: doc/**". But the "Validate post job" is a required job, therefore a PR cannot -# be merged unless the "Validate post job" completes succesfully, which it doesn't do if we +# be merged unless the "Validate post job" completes succesfully, which it doesn't do if we # filter it out. # # The solution: We use a second job with the same name which always returns the exit code 0. diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 593514beb2f..2a5587ce5ea 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -285,7 +285,7 @@ jobs: run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc ${{ env.EXTRA_GHC }} build-alpine: - name: Build statically linked using alpine + name: Build statically linked using alpine runs-on: "ubuntu-latest" container: "alpine:3.19" steps: From 2ea012eb1cce021f289169984ef48ff7f7953aa9 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 11:01:07 -0400 Subject: [PATCH 04/12] Fix whitespace in docs --- CONTRIBUTING.md | 4 ++-- README.md | 4 ++-- doc/cabal-commands.rst | 8 ++++---- doc/getting-started.rst | 20 ++++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abfddd7715d..5ca5544106b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -142,7 +142,7 @@ and should be written in the body of the ticket or PR under their own heading, l For instance: > \#\# QA Notes -> +> > Calling `cabal haddock-project` should produce documentation for the whole cabal project with the following defaults enabled: > * Documentation lives in ./haddocks > * The file `./haddocks/index.html` should exist @@ -408,7 +408,7 @@ Running workflow manually as discussed above requires you to supply two inputs: Going via an example, imagine that Cabal only allows `tar` or version less then or equal to 0.6, and you want to bump it to 0.6. Then, to show that Validate -succeeds with `tar` 0.6, you should input +succeeds with `tar` 0.6, you should input - `tar` to the "allow-newer line" - `tar ==0.6` to the "constraints line" diff --git a/README.md b/README.md index 008a6be0b22..bf6ea795060 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Currently, we only provide binaries for `x86_64` platforms. ``` Replace "Linux" with "Windows" or "macOS" as appropriate. - + The default Linux build is dynamically linked against `zlib`, `gmp` and `glibc`. You will need to have appropriate versions of these libraries installed to use it. Alternatively a statically linked "Linux-static" binary is also provided. @@ -51,7 +51,7 @@ Currently, we only provide binaries for `x86_64` platforms. You might need to add the following to your `cabal.project` file if your build fails because of an out-of-date `Cabal` library: ``` - allow-newer: + allow-newer: *:Cabal, *:Cabal-syntax diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 229a5b7a616..3508d64e817 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -1381,8 +1381,8 @@ to Hackage. .. option:: -t TOKEN or -tTOKEN, --token=TOKEN - Your Hackage authentication token. You can create and delete - authentication tokens on Hackage's `account management page + Your Hackage authentication token. You can create and delete + authentication tokens on Hackage's `account management page `__. .. option:: -u USERNAME or -uUSERNAME, --username=USERNAME @@ -1416,8 +1416,8 @@ cabal report .. option:: -t TOKEN or -tTOKEN, --token=TOKEN - Your Hackage authentication token. You can create and delete - authentication tokens on Hackage's `account management page + Your Hackage authentication token. You can create and delete + authentication tokens on Hackage's `account management page `__. .. option:: -u USERNAME or -uUSERNAME, --username=USERNAME diff --git a/doc/getting-started.rst b/doc/getting-started.rst index 39a095a7453..b04140a2189 100644 --- a/doc/getting-started.rst +++ b/doc/getting-started.rst @@ -4,16 +4,16 @@ Getting Started Installing Cabal ---------------- -The easiest and recommended way to install the ``cabal`` command-line tool -on Linux, macOS, FreeBSD or Windows is through `ghcup `__. +The easiest and recommended way to install the ``cabal`` command-line tool +on Linux, macOS, FreeBSD or Windows is through `ghcup `__. It installs the “Haskell toolchain”, which includes Cabal, -the Haskell compiler `GHC `__ +the Haskell compiler `GHC `__ and optionally other useful Haskell tools. Creating a new application -------------------------- -We create a minimal Haskell application to get a quick overview +We create a minimal Haskell application to get a quick overview of the ``cabal`` command-line tool: 1. How to initialize a Haskell package. @@ -59,9 +59,9 @@ The ``myapp.cabal`` file is a package description file, commonly referred to as default-language: Haskell2010 It contains metadata (package name and version, author name, license, etc.) and sections -to define package components. Components can be used to split large codebases into smaller, +to define package components. Components can be used to split large codebases into smaller, more managable building blocks. -A component can be of one of several types (executable, library, etc.) and describes, +A component can be of one of several types (executable, library, etc.) and describes, among other things, the location of source files and its dependencies. The ``myapp.cabal`` file above defines a single component named ``myapp`` of the executable type. Inside the ``executable`` section, the ``build-depends`` field lists the dependencies of this component. @@ -77,7 +77,7 @@ The ``app/Main.hs`` file is where your executable's code lives: main = putStrLn "Hello, Haskell!" -To run the executable, switch into the application directory with ``cd myapp`` and run +To run the executable, switch into the application directory with ``cd myapp`` and run .. code-block:: console @@ -86,7 +86,7 @@ To run the executable, switch into the application directory with ``cd myapp`` a Hello, Haskell! This command automatically determines if the executable needs to be (re)built -before running the executable. With only one executable component in the package, +before running the executable. With only one executable component in the package, ``cabal run`` (without a component name) is smart enough to infer it, so the name can be omitted. If you just want to build the executable without running it, run: @@ -181,11 +181,11 @@ Now you can build and re-run your code to see the new output: Running a single-file Haskell script ------------------------------------ -Cabal also supports running single-file Haskell scripts like +Cabal also supports running single-file Haskell scripts like the following file named ``myscript``: .. code-block:: haskell - + #!/usr/bin/env cabal {- cabal: build-depends: From e420bf25bdc367b978456405f485c4a5c5499905 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Wed, 13 Mar 2024 12:45:38 -0400 Subject: [PATCH 05/12] Fix whitespace in *.hs sources --- Cabal-described/src/Distribution/Described.hs | 2 +- Cabal-described/src/Distribution/Utils/CharSet.hs | 2 +- Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs | 2 +- bootstrap/src/Main.hs | 2 +- cabal-install-solver/src/Distribution/Solver/Modular/Message.hs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cabal-described/src/Distribution/Described.hs b/Cabal-described/src/Distribution/Described.hs index b158fe02a77..3bfd8c2e3a4 100644 --- a/Cabal-described/src/Distribution/Described.hs +++ b/Cabal-described/src/Distribution/Described.hs @@ -591,4 +591,4 @@ instance Described CompatLicenseFile where describe _ = describe ([] :: [Token]) instance Described CompatFilePath where - describe _ = describe ([] :: [Token]) \ No newline at end of file + describe _ = describe ([] :: [Token]) diff --git a/Cabal-described/src/Distribution/Utils/CharSet.hs b/Cabal-described/src/Distribution/Utils/CharSet.hs index 3cb9ba500a8..9243615c7fa 100644 --- a/Cabal-described/src/Distribution/Utils/CharSet.hs +++ b/Cabal-described/src/Distribution/Utils/CharSet.hs @@ -244,4 +244,4 @@ upper = foldl' (flip insert) empty [ c | c <- [ minBound .. maxBound ], isUpper -- $setup -- Use -XOverloadedStrings to avoid the error: Couldn't match type ‘[Char]’ with ‘CharSet’ -- >>> :set -XOverloadedStrings --- >>> import Prelude (length) \ No newline at end of file +-- >>> import Prelude (length) diff --git a/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs b/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs index c399118f893..9fc9b3409e3 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs @@ -190,4 +190,4 @@ options_9_0_all = options_9_0_affects :: [String] options_9_0_affects = [ "-fcmm-static-pred" - ] \ No newline at end of file + ] diff --git a/bootstrap/src/Main.hs b/bootstrap/src/Main.hs index 8f06acba2ce..04e3bd59dd1 100644 --- a/bootstrap/src/Main.hs +++ b/bootstrap/src/Main.hs @@ -113,7 +113,7 @@ main2 meta plan = do case P.uPkgSrc unit of Just (P.RepoTarballPackage (P.RepoSecure _uri)) -> return Hackage - Just (P.LocalUnpackedPackage _path) -> + Just (P.LocalUnpackedPackage _path) -> return Local pkgsrc -> die $ "package source not supported: " ++ show pkgsrc diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs index 11fa7ca874d..810e5121002 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/Message.hs @@ -357,4 +357,4 @@ showConflictingDep (ConflictingDep dr (PkgComponent qpn comp) ci) = -- >>> let v0 = POption (I (mkVersion [0]) InRepo) Nothing -- >>> let v1 = POption (I (mkVersion [1]) InRepo) Nothing -- >>> let i0 = POption (I (mkVersion [0]) (Inst $ mkUnitId "foo-bar-0-inplace")) Nothing --- >>> let i1 = POption (I (mkVersion [1]) (Inst $ mkUnitId "foo-bar-1-inplace")) Nothing \ No newline at end of file +-- >>> let i1 = POption (I (mkVersion [1]) (Inst $ mkUnitId "foo-bar-1-inplace")) Nothing From e386a13c504f4a7348aca01464c57cdfb18ef6a0 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Wed, 13 Mar 2024 12:43:01 -0400 Subject: [PATCH 06/12] Add missing line at EOF for cabal-testsuite/**/*.hs - Fix whitespace in cabal-testsuite + other tests --- .../tests/UnitTests/Distribution/Simple/Program/GHC.hs | 4 ++-- cabal-install/tests/IntegrationTests2/.gitignore | 2 +- .../Backpack/Includes2/setup-per-component.test.hs | 2 +- .../PackageTests/CmmSourcesExe/cmmexperiment.cabal | 1 - .../PackageTests/ExternalCommandSetup/setup.cabal.hs | 1 - .../PackageTests/NewBuild/CmdRepl/CustomSetup/foo/Setup.hs | 2 +- .../Projects-Default-No/cabal.dot-uv.test.hs | 2 +- .../Projects-Default-No/cabal.dot-uv.v2.test.hs | 2 +- .../Projects-Default-No/cabal.ignore-project.test.hs | 2 +- .../Projects-Default-No/cabal.ignore-project.v2.test.hs | 2 +- .../Projects-Default-No/cabal.no-project.test.hs | 2 +- .../Projects-Default-No/cabal.no-project.v2.test.hs | 2 +- .../Projects-Default-No/cabal.sub-pq.test.hs | 2 +- .../Projects-Default-No/cabal.sub-pq.v2.test.hs | 2 +- .../Projects-Default-No/cabal.sub-rs.test.hs | 2 +- .../Projects-Default-No/cabal.sub-rs.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.dot-uv.test.hs | 2 +- .../Projects-Default-Yes/cabal.dot-uv.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.ignore-project.test.hs | 2 +- .../Projects-Default-Yes/cabal.ignore-project.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.no-project.test.hs | 2 +- .../Projects-Default-Yes/cabal.no-project.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.project.test.hs | 2 +- .../Projects-Default-Yes/cabal.project.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.sub-pq.test.hs | 2 +- .../Projects-Default-Yes/cabal.sub-pq.v2.test.hs | 2 +- .../Projects-Default-Yes/cabal.sub-rs.test.hs | 2 +- .../Projects-Default-Yes/cabal.sub-rs.v2.test.hs | 2 +- .../PackageTests/SDist/Respect-Project-File/README.md | 2 +- .../SDist/Respect-Project-File/cabal.ignore-project.test.hs | 2 +- .../Respect-Project-File/cabal.ignore-project.v2.test.hs | 2 +- .../SDist/Respect-Project-File/cabal.no-project.test.hs | 2 +- .../SDist/Respect-Project-File/cabal.no-project.v2.test.hs | 2 +- cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs | 2 +- cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs | 2 +- cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs | 2 +- .../WarnEarlyOverwrite/clean-install-by-copy.test.hs | 2 +- .../WarnEarlyOverwrite/clean-install-by-symlink.test.hs | 2 +- .../PackageTests/WarnEarlyOverwrite/dirty-install.test.hs | 2 +- 39 files changed, 38 insertions(+), 40 deletions(-) diff --git a/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs b/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs index 9fc9b3409e3..d66b2eb4316 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Simple/Program/GHC.hs @@ -53,12 +53,12 @@ tests = testGroup "Distribution.Simple.Program.GHC" , compilerCompat = [] , compilerLanguages = [] , compilerExtensions = [] - , compilerProperties = Map.singleton "Support parallel --make" "YES" + , compilerProperties = Map.singleton "Support parallel --make" "YES" }) (Platform X86_64 Linux) (mempty { ghcOptNumJobs = Flag (NumJobs (Just 4)) }) assertListEquals flags ["-j4", "-clear-package-db"] - ] + ] ] assertListEquals :: (Eq a, Show a) => [a] -> [a] -> Assertion diff --git a/cabal-install/tests/IntegrationTests2/.gitignore b/cabal-install/tests/IntegrationTests2/.gitignore index ceb5549d4e8..7df6974cf10 100644 --- a/cabal-install/tests/IntegrationTests2/.gitignore +++ b/cabal-install/tests/IntegrationTests2/.gitignore @@ -1 +1 @@ -config/default-config \ No newline at end of file +config/default-config diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs index e94d2018d7c..5bbb1b02af2 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs @@ -4,7 +4,7 @@ main = setupTest $ do skipUnlessGhcVersion ">= 8.1" ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ - withPackageDb $ + withPackageDb $ withDirectory "Includes2" $ do let setup_install' args = setup_install_with_docs args setup_install' ["mylib", "--cid", "mylib-0.1.0.0"] diff --git a/cabal-testsuite/PackageTests/CmmSourcesExe/cmmexperiment.cabal b/cabal-testsuite/PackageTests/CmmSourcesExe/cmmexperiment.cabal index b26391e6e84..c07aa265b4e 100644 --- a/cabal-testsuite/PackageTests/CmmSourcesExe/cmmexperiment.cabal +++ b/cabal-testsuite/PackageTests/CmmSourcesExe/cmmexperiment.cabal @@ -20,4 +20,3 @@ executable demo else cmm-options: -ddump-cmm - diff --git a/cabal-testsuite/PackageTests/ExternalCommandSetup/setup.cabal.hs b/cabal-testsuite/PackageTests/ExternalCommandSetup/setup.cabal.hs index d6bea04003f..7fb49a41923 100644 --- a/cabal-testsuite/PackageTests/ExternalCommandSetup/setup.cabal.hs +++ b/cabal-testsuite/PackageTests/ExternalCommandSetup/setup.cabal.hs @@ -11,4 +11,3 @@ main = setupTest $ do res <- fails $ withDirectory "custom" $ setup' "aaaa" [] assertOutputContains "unrecognised command" res - diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/CustomSetup/foo/Setup.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/CustomSetup/foo/Setup.hs index 4cfb12a5527..5f30459ab90 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/CustomSetup/foo/Setup.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/CustomSetup/foo/Setup.hs @@ -5,4 +5,4 @@ import qualified Distribution.Simple as DS import Distribution.Simple.Setup main :: IO () -main = DS.defaultMainWithHooks DS.simpleUserHooks +main = DS.defaultMainWithHooks DS.simpleUserHooks diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.test.hs index 03f2535de4a..f45ed508b31 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.test.hs @@ -9,4 +9,4 @@ import Test.Cabal.Prelude -- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the -- expected output to what we'd expect if "cabal sdist" respected the project. main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.v2.test.hs index 5f6c3ba1a83..c39feac79b3 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal -- v2-sdist" writes sdist/uv-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.test.hs index 6b77d12d2fe..90432e4fbb8 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.test.hs @@ -2,4 +2,4 @@ import Test.Cabal.Prelude -- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package. main = cabalTest $ do - cabal "sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.v2.test.hs index a159257eb68..94abd67e057 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.ignore-project.v2.test.hs @@ -5,4 +5,4 @@ import Test.Cabal.Prelude -- and wrote sdist/p-0.1.tar.gz. That is incorrect. It didn't ignore the -- project. main = cabalTest $ do - cabal "v2-sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "v2-sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.test.hs index 0002f9f4004..49bd8ecf713 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.test.hs @@ -6,4 +6,4 @@ import Test.Cabal.Prelude -- project probing would not occur and "cabal sdist" would work on the local -- uv.cabal package. main = cabalTest $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.v2.test.hs index 5030fff5141..6cdef39733a 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.no-project.v2.test.hs @@ -6,4 +6,4 @@ import Test.Cabal.Prelude -- seen) is that project probing would not occur and "cabal v2-sdist" would work -- on the local uv.cabal package. main = cabalTest $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.test.hs index 19447044121..8ad8bbd1233 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.test.hs @@ -9,4 +9,4 @@ import Test.Cabal.Prelude -- TODO: Fix this behaviour and apply the patch cabal.sub-pq.patch to update the -- expected output to what we'd expect if "cabal sdist" respected the project. main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.v2.test.hs index aec07983845..a82397a4ef6 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.test.hs index 3dd58bf6b97..d6ecf063192 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.test.hs @@ -9,4 +9,4 @@ import Test.Cabal.Prelude -- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the -- expected output to what we'd expect if "cabal sdist" respected the project. main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.v2.test.hs index 66b8378a1cd..a0c14d19645 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-rs.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.sub-rs.project has "packages: r/ s/" and "cabal v2-sdist" writes -- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.test.hs index 7ca9d1fa282..3c0f776a70c 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.test.hs @@ -9,4 +9,4 @@ import Test.Cabal.Prelude -- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the -- expected output to what we'd expect if "cabal sdist" respected the project. main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.v2.test.hs index 2df773c5510..4f12de028e9 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.dot-uv.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal -- v2-sdist" writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. That is correct. main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.test.hs index 6b77d12d2fe..90432e4fbb8 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.test.hs @@ -2,4 +2,4 @@ import Test.Cabal.Prelude -- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package. main = cabalTest $ do - cabal "sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.v2.test.hs index e98c7717e4d..d017d47317a 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.ignore-project.v2.test.hs @@ -4,4 +4,4 @@ import Test.Cabal.Prelude -- sdist/uv-0.1.tar.gz for the uv.cabal package but instead it wrote -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. main = cabalTest $ do - cabal "v2-sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "v2-sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.test.hs index 1699b269a2c..b25efe2a0d9 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.test.hs @@ -7,4 +7,4 @@ import Test.Cabal.Prelude -- TODO: Check that the code is behaving the same as it would have if -- "--project-file=cabal.project" was given or if it is using project probing. main = cabalTest $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.v2.test.hs index 10ffa0c5a4d..4f9189489cb 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.no-project.v2.test.hs @@ -4,4 +4,4 @@ import Test.Cabal.Prelude -- has "packages: p/ q/" and writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. -- This is correct. main = cabalTest $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.test.hs index 6be41cfc24f..81b6cc511b1 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.test.hs @@ -4,4 +4,4 @@ import Test.Cabal.Prelude -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct but likely -- accidental as the default cabal.project has the same packages. main = cabalTest . withProjectFile "cabal.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.v2.test.hs index f94f478f6ae..29aafe0c99d 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.project.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- The given cabal.project has has "packages: p/ q/" and "cabal v2-sdist" writes -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.test.hs index 92995d4994b..63803ba8851 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.sub-pq.project has "packages: p/ q/" and "cabal sdist" writes -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.v2.test.hs index aec07983845..a82397a4ef6 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-pq.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes -- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct. main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.test.hs index e20c7337d49..e8977aa1770 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.test.hs @@ -9,4 +9,4 @@ import Test.Cabal.Prelude -- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the -- expected output to what we'd expect if "cabal sdist" respected the project. main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.v2.test.hs index 239f91b1e28..fa7bb0b266f 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-Yes/cabal.sub-rs.v2.test.hs @@ -3,4 +3,4 @@ import Test.Cabal.Prelude -- cabal.sub-rs.project has "packages: r/ s/" and "cabal v2-sdist" writes -- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. That is correct. main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/README.md b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/README.md index 0b3da4f9090..e400102d3a4 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/README.md +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/README.md @@ -51,7 +51,7 @@ with these tests. `cabal.project` instead; either the one one in the current directory or the one from the parent directory, one level up. I think this behaviour is wrong and the supplied `--project-file` option should be respected. - + Before I'd put a project there, one level up, the project probing had gone all the way up to Cabal's own `cabal.project` as can be seen by this diff after that change: diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.test.hs index 7d3628c2b43..3145737a646 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.test.hs @@ -2,4 +2,4 @@ import Test.Cabal.Prelude -- This test correctly writes sdist/z-0.1.tar.gz for the z.cabal package. main = cabalTest $ do - cabal "sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.v2.test.hs index 7d3628c2b43..3145737a646 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.ignore-project.v2.test.hs @@ -2,4 +2,4 @@ import Test.Cabal.Prelude -- This test correctly writes sdist/z-0.1.tar.gz for the z.cabal package. main = cabalTest $ do - cabal "sdist" ["all", "--ignore-project"] \ No newline at end of file + cabal "sdist" ["all", "--ignore-project"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs index defb9406c3c..8f440b78ca6 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.test.hs @@ -4,4 +4,4 @@ import Test.Cabal.Prelude -- has "packages: Projects-Default-No/p" and writes sdist/p-0.1.tar.gz. This is -- correct. main = cabalTest $ do - cabal "sdist" ["all"] \ No newline at end of file + cabal "sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.v2.test.hs b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.v2.test.hs index d86a6792458..54cc62f9608 100755 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.v2.test.hs +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.no-project.v2.test.hs @@ -4,4 +4,4 @@ import Test.Cabal.Prelude -- has "packages: Projects-Default-No/p" and writes sdist/p-0.1.tar.gz. This is -- correct. main = cabalTest $ do - cabal "v2-sdist" ["all"] \ No newline at end of file + cabal "v2-sdist" ["all"] diff --git a/cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs b/cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs index 07fe0af96a9..cb94faaa1e2 100644 --- a/cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs +++ b/cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs @@ -1,4 +1,4 @@ import Test.Cabal.Prelude main = cabalTest . withRepo "repo" . withProjectFile "0-local.project" $ do - fails $ cabal "v2-build" ["--dry-run"] \ No newline at end of file + fails $ cabal "v2-build" ["--dry-run"] diff --git a/cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs b/cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs index 14723adb067..2b19536eb30 100644 --- a/cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs +++ b/cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs @@ -6,4 +6,4 @@ testVersionWin project = main = cabalTest . withRepo "repo" $ do testVersionWin "1-local-constraints-import.project" - testVersionWin "1-local-import-constraints.project" \ No newline at end of file + testVersionWin "1-local-import-constraints.project" diff --git a/cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs b/cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs index 4e4e61266be..9289e16d0d6 100644 --- a/cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs +++ b/cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs @@ -6,4 +6,4 @@ testVersionWin project = main = cabalTest . withRepo "repo" $ do testVersionWin "2-local-constraints-import.project" - testVersionWin "2-local-import-constraints.project" \ No newline at end of file + testVersionWin "2-local-import-constraints.project" diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs index af7d6f33625..700421fcedb 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs @@ -10,4 +10,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do -- +Warning: The directory /incoming/new-2448/Users/RUNNER~1/AppData/Local/Temp/cabal-test-store-28260/ghc-/WarnEarlyOver_-0.1.0.0-4c19059e06a32b93b2812983631117e77a2d3833/bin is not in the system search path. -- +Copying 'warn-early-overwrite' to '' skipIfWindows - cabalG options "v2-install" ["--install-method=copy"] \ No newline at end of file + cabalG options "v2-install" ["--install-method=copy"] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs index 1fa303cb2bc..c2d12c0caf1 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs @@ -4,4 +4,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do -- The default install method is symlink that may not work on Windows. skipIfWindows let options = ["--store-dir=" ++ storeDir, "--installdir=" ++ storeDir] - cabalG options "v2-install" [] \ No newline at end of file + cabalG options "v2-install" [] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs index 6578a891c0d..c91ee226ba9 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs @@ -10,4 +10,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do -- Touch the target to see if the warning is made early before the build. _ <- runM "touch" [storeDir "warn-early-overwrite"] Nothing fails $ cabalG options "v2-install" [] - cabalG options "v2-install" ["--overwrite-policy=always"] \ No newline at end of file + cabalG options "v2-install" ["--overwrite-policy=always"] From b790751cc5815050163173e53ebf6ef499565b86 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 11:02:56 -0400 Subject: [PATCH 07/12] Fix whitespace in fourmolu configuration --- fourmolu.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fourmolu.yaml b/fourmolu.yaml index acd4a166328..40b1e42207b 100644 --- a/fourmolu.yaml +++ b/fourmolu.yaml @@ -14,7 +14,7 @@ let-style: auto fixities: # Distribution.Compat.Parsing - - infixr 0 + - infixr 0 # Distribution.FieldGrammar - infixl 5 ^^^ # Distribution.Types.InstalledPackageInfo.FieldGrammar From ed4c36a2aa25b00f17cec10996e651147f0edff8 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 11:40:32 -0400 Subject: [PATCH 08/12] Configure fix-whitespace to include *.project Needed for POSIX compliance for text files --- fix-whitespace.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/fix-whitespace.yaml b/fix-whitespace.yaml index d96e84188b1..7fdfb108627 100644 --- a/fix-whitespace.yaml +++ b/fix-whitespace.yaml @@ -40,6 +40,7 @@ included-files: - .gitattributes - AUTHORS - LICENSE + - "*.project" - "cabal.project.*" - "*.ac" - "*.bat" From 38eb1e826c0e587b404612f6a73bdc4cfae987c3 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 11:41:03 -0400 Subject: [PATCH 09/12] Fix whitespace in *.project --- .../tests/IntegrationTests2/build/ignore-project/cabal.project | 2 +- cabal-install/tests/fixtures/configure/cabal.project | 2 +- cabal-testsuite/PackageTests/ExtraProgPath/cabal.project | 2 +- cabal-testsuite/PackageTests/HaddockArgs/cabal.project | 2 +- cabal-testsuite/PackageTests/HaddockWarn/cabal.project | 2 +- .../PackageTests/NewBuild/CmdRun/Script/cabal.project | 2 +- .../PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.project | 2 +- cabal-testsuite/PackageTests/NewHaddock/Fails/cabal.project | 2 +- .../PackageTests/NewSdist/DeterministicTrivial/cabal.project | 2 +- cabal-testsuite/PackageTests/PkgConfigParse/cabal.project | 2 +- .../PackageTests/Regression/T5213ExeCoverage/cabal.project | 2 +- .../PackageTests/Regression/T5782Diamond/cabal.project | 2 +- .../PackageTests/RelativePathProjectImports/cabal.project | 2 +- .../PackageTests/SDist/Respect-Project-File/cabal.project | 2 +- cabal-testsuite/PackageTests/SDist/T5195and5349/cabal.project | 2 +- .../VersionPriority/3-web-constraints-import.project | 2 +- .../VersionPriority/3-web-import-constraints.project | 2 +- cabal-testsuite/PackageTests/WarnEarlyOverwrite/cabal.project | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cabal-install/tests/IntegrationTests2/build/ignore-project/cabal.project b/cabal-install/tests/IntegrationTests2/build/ignore-project/cabal.project index 3b1b4b67d20..f704d26df20 100644 --- a/cabal-install/tests/IntegrationTests2/build/ignore-project/cabal.project +++ b/cabal-install/tests/IntegrationTests2/build/ignore-project/cabal.project @@ -1,3 +1,3 @@ packages: . -coverage: true \ No newline at end of file +coverage: true diff --git a/cabal-install/tests/fixtures/configure/cabal.project b/cabal-install/tests/fixtures/configure/cabal.project index 863b8879eb7..8d7afa6e902 100644 --- a/cabal-install/tests/fixtures/configure/cabal.project +++ b/cabal-install/tests/fixtures/configure/cabal.project @@ -1,2 +1,2 @@ ignore-project: False -optimization: 2 \ No newline at end of file +optimization: 2 diff --git a/cabal-testsuite/PackageTests/ExtraProgPath/cabal.project b/cabal-testsuite/PackageTests/ExtraProgPath/cabal.project index 5a93e28e878..0d7f076e888 100644 --- a/cabal-testsuite/PackageTests/ExtraProgPath/cabal.project +++ b/cabal-testsuite/PackageTests/ExtraProgPath/cabal.project @@ -1 +1 @@ -packages: *.cabal \ No newline at end of file +packages: *.cabal diff --git a/cabal-testsuite/PackageTests/HaddockArgs/cabal.project b/cabal-testsuite/PackageTests/HaddockArgs/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/HaddockArgs/cabal.project +++ b/cabal-testsuite/PackageTests/HaddockArgs/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/HaddockWarn/cabal.project b/cabal-testsuite/PackageTests/HaddockWarn/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/HaddockWarn/cabal.project +++ b/cabal-testsuite/PackageTests/HaddockWarn/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.project b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.project +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.project b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.project +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/NewHaddock/Fails/cabal.project b/cabal-testsuite/PackageTests/NewHaddock/Fails/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/Fails/cabal.project +++ b/cabal-testsuite/PackageTests/NewHaddock/Fails/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/cabal.project b/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/cabal.project +++ b/cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project b/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project index 5a93e28e878..0d7f076e888 100644 --- a/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project +++ b/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project @@ -1 +1 @@ -packages: *.cabal \ No newline at end of file +packages: *.cabal diff --git a/cabal-testsuite/PackageTests/Regression/T5213ExeCoverage/cabal.project b/cabal-testsuite/PackageTests/Regression/T5213ExeCoverage/cabal.project index ee157cb0f02..122a107db70 100644 --- a/cabal-testsuite/PackageTests/Regression/T5213ExeCoverage/cabal.project +++ b/cabal-testsuite/PackageTests/Regression/T5213ExeCoverage/cabal.project @@ -2,4 +2,4 @@ packages: . package cabal-gh5213 coverage: True - optimization: False \ No newline at end of file + optimization: False diff --git a/cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.project b/cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.project index 0d2e55b4b44..858544b8292 100644 --- a/cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.project +++ b/cabal-testsuite/PackageTests/Regression/T5782Diamond/cabal.project @@ -1 +1 @@ -packages: issue5782 \ No newline at end of file +packages: issue5782 diff --git a/cabal-testsuite/PackageTests/RelativePathProjectImports/cabal.project b/cabal-testsuite/PackageTests/RelativePathProjectImports/cabal.project index 8eceb95e1a5..c95da21fb66 100644 --- a/cabal-testsuite/PackageTests/RelativePathProjectImports/cabal.project +++ b/cabal-testsuite/PackageTests/RelativePathProjectImports/cabal.project @@ -3,4 +3,4 @@ import: ./dep/cabal.project packages: main.cabal dep/dep.cabal - dep2/dep2.cabal \ No newline at end of file + dep2/dep2.cabal diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.project b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.project index c46fad9d90b..87a9ca689a2 100644 --- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.project +++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/cabal.project @@ -1 +1 @@ -packages: Projects-Default-No/p \ No newline at end of file +packages: Projects-Default-No/p diff --git a/cabal-testsuite/PackageTests/SDist/T5195and5349/cabal.project b/cabal-testsuite/PackageTests/SDist/T5195and5349/cabal.project index bfe62896560..6f920794c80 100644 --- a/cabal-testsuite/PackageTests/SDist/T5195and5349/cabal.project +++ b/cabal-testsuite/PackageTests/SDist/T5195and5349/cabal.project @@ -1 +1 @@ -packages: ./ \ No newline at end of file +packages: ./ diff --git a/cabal-testsuite/PackageTests/VersionPriority/3-web-constraints-import.project b/cabal-testsuite/PackageTests/VersionPriority/3-web-constraints-import.project index 74f5ef66fd9..b9d046a4c59 100644 --- a/cabal-testsuite/PackageTests/VersionPriority/3-web-constraints-import.project +++ b/cabal-testsuite/PackageTests/VersionPriority/3-web-constraints-import.project @@ -2,4 +2,4 @@ packages: . allow-newer: hashable:* constraints: hashable ==1.4.2.0 import: hop-web.config -import: with-ghc.config \ No newline at end of file +import: with-ghc.config diff --git a/cabal-testsuite/PackageTests/VersionPriority/3-web-import-constraints.project b/cabal-testsuite/PackageTests/VersionPriority/3-web-import-constraints.project index 5a103e19a80..b37fb3bbb72 100644 --- a/cabal-testsuite/PackageTests/VersionPriority/3-web-import-constraints.project +++ b/cabal-testsuite/PackageTests/VersionPriority/3-web-import-constraints.project @@ -2,4 +2,4 @@ packages: . allow-newer: hashable:* import: hop-web.config constraints: hashable ==1.4.2.0 -import: with-ghc.config \ No newline at end of file +import: with-ghc.config diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/cabal.project b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/cabal.project index 5356e76f67c..e6fdbadb439 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/cabal.project +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/cabal.project @@ -1 +1 @@ -packages: . \ No newline at end of file +packages: . From b414fafc478134554afdca2f99a8770a965d436d Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 12:03:29 -0400 Subject: [PATCH 10/12] Ignore generated doc/buildinfo-fields-reference.rst --- fix-whitespace.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/fix-whitespace.yaml b/fix-whitespace.yaml index 7fdfb108627..d5eb572ec62 100644 --- a/fix-whitespace.yaml +++ b/fix-whitespace.yaml @@ -118,6 +118,7 @@ excluded-files: - "*.golden" - "*.log" - "*.out" + - doc/buildinfo-fields-reference.rst # Binary files - "*.a" From 834e1ed638621c5a77a832bd933ba91bf4779c77 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 14 Mar 2024 20:22:35 -0400 Subject: [PATCH 11/12] Reduce double space between prose words Co-authored-by: brandon s allbery kf8nh --- doc/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting-started.rst b/doc/getting-started.rst index b04140a2189..056c4a85ebd 100644 --- a/doc/getting-started.rst +++ b/doc/getting-started.rst @@ -77,7 +77,7 @@ The ``app/Main.hs`` file is where your executable's code lives: main = putStrLn "Hello, Haskell!" -To run the executable, switch into the application directory with ``cd myapp`` and run +To run the executable, switch into the application directory with ``cd myapp`` and run .. code-block:: console From eb87ffdf2cb797c6296fcf3a7ddf5edca4420092 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Fri, 15 Mar 2024 06:11:26 -0400 Subject: [PATCH 12/12] Use fix-whitespace-action --- .github/workflows/whitespace.yml | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml index cbdf9ca914c..46088d3d351 100644 --- a/.github/workflows/whitespace.yml +++ b/.github/workflows/whitespace.yml @@ -9,35 +9,6 @@ jobs: whitespace: runs-on: ubuntu-latest - env: - fix-whitespace-ver: '0.1' - steps: - uses: actions/checkout@v4 - - - name: Create directory for binary - run: | - mkdir -p $HOME/.local/bin - - - uses: actions/cache@v3 - name: Cache the binary - id: cache - with: - path: "~/.local/bin" - key: fix-whitespace-${{ env.fix-whitespace-ver }} - - - uses: haskell-actions/setup@v2 - if: ${{ !steps.cache.outputs.cache-hit }} - with: - ghc-version: '9.8' - cabal-version: latest - - - name: Install fix-whitespace - if: ${{ !steps.cache.outputs.cache-hit }} - run: | - cabal install --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }} - strip $HOME/.local/bin/fix-whitespace - - - name: Check Whitespace Conformance - run: | - $HOME/.local/bin/fix-whitespace --check + - uses: andreasabel/fix-whitespace-action@v1