Skip to content

Can't disable code formatting on save #375

Closed

Description

@mzannoni

autopep8 and Yapf are both disabled. Atom has been restarted.

However, every time I press Ctrl+S, the entire file is changed (due to reformatting of white spaces, mostly).

This happens since last update of the ide-python package.

I think this is a bug.
At the moment, I had to disable ide-python.

Atom: 1.58
ide-python: 1.9.4
Ubuntu 20.04.2 LTS x86_64

Activity

  1. mzannoni commented on Jul 31, 2021

    @mzannoni
    Author

    I don't know if it's related.
    Another thing that is happening since last update is that at start, Atom warns that the linter and the diagnistics are conflicting and one of the 2 should be disabled.

  2. mzannoni commented on Jul 31, 2021

    @mzannoni
    Author

    Additional note: downgrading ide-python to v 1.9.3 solves this issue (but not the one with the linter and diagnostics, so I suspect this latter is not necessarily related).

  3. s-m-e commented on Aug 8, 2021

    @s-m-e

    Another thing that is happening since last update is that at start, Atom warns that the linter and the diagnistics are conflicting and one of the 2 should be disabled.

    I can confirm this behavior. Only workaround I could find (so far): Starting all over with a fresh Atom profile folder.

  4. aminya commented on Aug 9, 2021

    @aminya
    Member

    Inside atom-ide-code-format settings remove the option for "automatic code formatting on save"

  5. mzannoni commented on Aug 9, 2021

    @mzannoni
    Author

    Inside atom-ide-code-format settings remove the option for "automatic code formatting on save"

    Yes, I confirm this works, but it disables entirely the code formatting features (also the ones given by "whitespace" plugin for instance.
    The only issue I see now is with ide-python (which was not there in previous versions). It seems I can't disable code formatting features of ide-python (some are a bit annoying, like when it re-arranges entire portions of code, e.g. swapping lines to put all the imports at the beginning [yes, I know it's is best practice... but I'd like to be free to write badly formatted code if I need/want]).

  6. mzannoni commented on Aug 9, 2021

    @mzannoni
    Author

    Ok, I've seen just now that a new version of ide-python was available.
    It seems taht solves the issue: disabling autopep8 effectively prevents code formatting on save (enabling it works properly as well, e.g. "import" lines are shoved all the way to the top of a file).

    I guess this could be considered solved?
    (but yeah, I still have the notice at Atom startup about linter vs. diagnostics... not sure what to do with that)

  7. aminya commented on Aug 10, 2021

    @aminya
    Member

    Thanks!

  8. linked a pull request that will close this issuefix: config works with pylsp / pyls #383on Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions