Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow configuring indent size, etc. for autopep8

Open
#24 13 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, vim
Domain
tooling

Research direction

Start at the Vimscript entry point that invokes autopep8 and review how formatter options are currently passed. Define how a flag or buffer-local variable should map to autopep8's indent-size, max-line-length, and ignore settings, including optional use of Vim's shiftwidth and textwidth; done means these settings can be configured without repeating them in a config file.

Written by the indexing model from the issue text.

Description

enhancement

autopep8 allows configuring the indent-size and max-line-length to use as well as listing error codes to be ignored like --ignore=E226,E302,E41. It's currently possible to configure those via pep8 config files by putting something like the following in ~/.config/pep8 or a per-project setup.cfg or tox.ini:

[pep8]
indent-size = 2
max-line-length = 100
ignore = E226,E302,E41

Config files work pretty well in most cases, but it still would be nice to be able to configure via vimscript for some cases. I'm thinking there should be a flag and/or buffer-local variable that can be used to pass config to autopep8.

In particular, since vim already has settings that correspond to indent size and max line length, it would be great to have an option to hook those up to automatically match vim's 'shiftwidth' and 'textwidth' settings, since I've already configured formatting settings once and shouldn't be forced to repeat myself.

Dominant language
Vim Script
Stars
1.1k
Forks
102
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/vim-codefmt

All issues in google/vim-codefmt

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.