Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a separate basedpyrightconfig.json that combines with pyrightconfig.json #1100

Open
bzadon opened this issue Feb 23, 2025 · 1 comment
Labels
awaiting response waiting for more info from the author - will eventually close if they don't respond

Comments

@bzadon
Copy link

bzadon commented Feb 23, 2025

Description

My project is a team project with developers who use plain pyright. I'd like to add additional configuration settings but not have to commit those back to the main repo. If I could have a separate "overlay" config i.e. basedpyrightconfig.json, I can keep the basedpyright-only settings in there, away from the main config file.
Please consider. TIA!

@DetachHead
Copy link
Owner

DetachHead commented Feb 23, 2025

one of the main reasons i made basedpyright in the first place is because i wanted it to be possible for everyone in the team to have the same config. that way, if you see an error in your IDE you know it's something you have to fix, rather than something caused by you having a different version of pyright for example.

some questions:

  • if you have a separate config file to the rest of the developers in your team, you'll see errors in the code that you didn't put there, because another developer committed it without seeing the error on their side. how will you be able to easily differentiate between new errors you created and errors caused by someone else?
  • do you have pyright set up in your CI? if so, this will result in you seeing different errors locally to the errors that get reported in the CI, which is another problem i want to prevent

these are concerns i feel pretty strongly about. seeing different errors locally compared to other developers and the CI had been very frustrating to me in the past so i would highly recommend talking to your team and suggesting that basedpyright be adopted for the whole project. i may be biased but i believe it would greatly improve the developer experience for everybody in the team.

all of that said, a possible solution that could work for you is to create a separate config file and use extends to import the main one:

// basedpyrightconfig.json
{
    "extends": "./pyrightconfig.json",
    // additional settings here:
    "reportUnreachable": "error"
}

then run basedpyright -p basedpyrightconfig.json. (unfortunately this approach won't work with the language server until #941 is resolved)

@DetachHead DetachHead added the awaiting response waiting for more info from the author - will eventually close if they don't respond label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response waiting for more info from the author - will eventually close if they don't respond
Projects
None yet
Development

No branches or pull requests

2 participants