Make readFields warn about inconsistent indentation.
This is affect of using indentOfAtLeast method: any indentation greater than current offset is fine. That behavior is desirable to parsing multiline field contents, but it is a bit surprising for fields, which we expect to be aligned. Such insonsistency seems to be always a mistake, and it's easy to fix once a machine points it out.
Showing
- Cabal-syntax/src/Distribution/Fields/LexerMonad.hs 6 additions, 2 deletionsCabal-syntax/src/Distribution/Fields/LexerMonad.hs
- Cabal-syntax/src/Distribution/Fields/Parser.hs 29 additions, 3 deletionsCabal-syntax/src/Distribution/Fields/Parser.hs
- Cabal-syntax/src/Distribution/Parsec/Warning.hs 2 additions, 0 deletionsCabal-syntax/src/Distribution/Parsec/Warning.hs
- Cabal-tests/tests/CheckTests.hs 1 addition, 0 deletionsCabal-tests/tests/CheckTests.hs
- Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.cabal 72 additions, 0 deletions...ests/ParserTests/regressions/decreasing-indentation.cabal
- Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.check 2 additions, 0 deletions...ests/ParserTests/regressions/decreasing-indentation.check
- cabal-testsuite/PackageTests/Check/NonConfCheck/DuplicatedModules/pkg.cabal 1 addition, 1 deletion...ckageTests/Check/NonConfCheck/DuplicatedModules/pkg.cabal
- changelog.d/inconsistent-indentation 23 additions, 0 deletionschangelog.d/inconsistent-indentation
Loading
Please register or sign in to comment