Currently, when a flake8 error is reported, users have to manually update their configuration files (.flake8 or pyproject.toml) to suppress the error. This can be a time-consuming and error-prone process, especially for users who are not familiar with the flake8 configuration.
To improve the user experience, a quickfix should be provided for all flake8 problems that updates the configuration file with the necessary settings to suppress the error. For example, if the error message 'F401 | module imported but unused' is reported, the quickfix should offer to add the following configuration to the file:
[flake8]
extend-ignore = E203,F401
If the proposal in issue #135 is accepted, which adds flake8 configuration support for pyproject.toml, the updated configuration would look like this:
[tools.flake8]
extend-ignore = [ "E203", "F401"]
If a user does not have a configuration file, we should create a new section in the pyproject.toml for them. Alternatively, we could create the new .flake8 file for the user.
An alternative solution would be to include these configurations in the vscode/settings.json file, which is already used to store configurations. However, the 'pylance' module already uses the pyproject.toml directly, so adding these configurations to vscode/settings.json may not be the best solution.
Providing a quickfix for flake8 errors would greatly improve the user experience and reduce the time and effort required to configure flake8.
Issue description
Currently, when a flake8 error is reported, users have to manually update their configuration files (.flake8 or pyproject.toml) to suppress the error. This can be a time-consuming and error-prone process, especially for users who are not familiar with the flake8 configuration.
To improve the user experience, a quickfix should be provided for all flake8 problems that updates the configuration file with the necessary settings to suppress the error. For example, if the error message 'F401 | module imported but unused' is reported, the quickfix should offer to add the following configuration to the file:
If the proposal in issue #135 is accepted, which adds flake8 configuration support for pyproject.toml, the updated configuration would look like this:
If a user does not have a configuration file, we should create a new section in the pyproject.toml for them. Alternatively, we could create the new .flake8 file for the user.
An alternative solution would be to include these configurations in the vscode/settings.json file, which is already used to store configurations. However, the 'pylance' module already uses the pyproject.toml directly, so adding these configurations to vscode/settings.json may not be the best solution.
Providing a quickfix for flake8 errors would greatly improve the user experience and reduce the time and effort required to configure flake8.