Thread

  1. Add editorconfig support for Postgres spec files

    Tristan Partin <tristan@partin.io> — 2026-04-16T21:49:57Z

    I was reading through some spec files today, and my editor was resolving 
    the tab width as 8. I looked at some of the spec files, and we seem to 
    have standardized on a tab width of 4 with tabs expanded into spaces. 
    I decided to encode this in the .editorconfig file for convenience.
    
    PS: I am working on a tree-sitter grammar for these files. I'll probably 
    try to set up a TextMate grammar was well for those who use editors that 
    support that. I'll share that later.
    
    -- 
    Tristan Partin
    PostgreSQL Contributors Team
    AWS (https://aws.amazon.com)
    
  2. Re: Add editorconfig support for Postgres spec files

    Heikki Linnakangas <hlinnaka@iki.fi> — 2026-04-17T08:18:22Z

    On 17/04/2026 00:49, Tristan Partin wrote:
    > I was reading through some spec files today, and my editor was resolving
    > the tab width as 8. I looked at some of the spec files, and we seem to
    > have standardized on a tab width of 4 with tabs expanded into spaces.
    
    There's a mix of styles in different files. To pick a few random examples:
    
    src/test/isolation/specs/nowait.spec: indented with 2 spaces. But there 
    are some tabs too.
    
    src/test/modules/injection_points/specs/repack_toast.spec: Tabs
    
    src/test/modules/brin/specs/summarization-and-inprogress-insertion.spec: 
    Mix of tabs and spaces, width 4.
    
    Yeah, it would be nice to standardize on something...
    
    - Heikki
    
    
    
    
    
  3. Re: Add editorconfig support for Postgres spec files

    Jelte Fennema <postgres@jeltef.nl> — 2026-04-17T20:10:12Z

    On Fri, 17 Apr 2026 at 10:18, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
    > Yeah, it would be nice to standardize on something...
    
    Agreed.
    
    Whatever that standardized indenting style then is, it should then be
    encoded in .gitattributes. Our editorconfig file is generated based on
    that using src/tools/generate_editorconfig.py.
    
    I think in any case that script should be update to add some "DO NOT
    MODIFY MANUALLY! GENERATED USING src/tools/generate_editorconfig.py "
    header to the resulting editorconfig file. Because I agree that's not
    clear at the moment.
    
    
    
    
  4. Re: Add editorconfig support for Postgres spec files

    Michael Paquier <michael@paquier.xyz> — 2026-04-21T05:43:06Z

    On Fri, Apr 17, 2026 at 11:18:22AM +0300, Heikki Linnakangas wrote:
    > src/test/isolation/specs/nowait.spec: indented with 2 spaces. But there are
    > some tabs too.
    > 
    > src/test/modules/injection_points/specs/repack_toast.spec: Tabs
    > 
    > src/test/modules/brin/specs/summarization-and-inprogress-insertion.spec: Mix
    > of tabs and spaces, width 4.
    > 
    > Yeah, it would be nice to standardize on something...
    
    In terms of system_views.sql, the SQL input files in the regression
    test suites and the sample files, we are using whitespaces, not tabs.
    I cannot say much about the width part and what would be a good
    number, but at least it seems to me that the tabs should go.  We don't
    really have a strict width rule for the SQL files in the regression
    tests, and I don't think we need one.  It would be nice to keep the
    same flexibility for the isolation spec files.
    --
    Michael
    
  5. Re: Add editorconfig support for Postgres spec files

    Andreas Karlsson <andreas@proxel.se> — 2026-04-30T19:24:29Z

    On 4/17/26 22:10, Jelte Fennema-Nio wrote:
    > I think in any case that script should be update to add some "DO NOT
    > MODIFY MANUALLY! GENERATED USING src/tools/generate_editorconfig.py "
    > header to the resulting editorconfig file. Because I agree that's not
    > clear at the moment.
    
    You mean like this? I think the comment should point them towards the 
    script which generated it.
    
    --
    Andreas Karlsson
    Percona