microsoft / qsharp-compiler

Q# compiler, command line tool, and Q# language server
https://docs.microsoft.com/quantum
MIT License
682 stars 170 forks source link

Linter for Q# files #423

Open crazy4pi314 opened 4 years ago

crazy4pi314 commented 4 years ago

Is your feature request related to a problem? Please describe. It would be really nice to have a linter that can manage whitespace and formatting in Q# files to avoid spurious whitespace changes and consistent code.

Describe the solution you'd like A tool like Black for python but for Q#?

Describe alternatives you've considered Adding to the style guide suggestions for how to handle whitespace/line break sort of formatting.

Additional context Thanks!💖

HaoZeke commented 4 years ago

We could also look into setting up an editorconfig file. That'd work for many different editors.

swernli commented 4 years ago

We have a hackathon project that is working on a linter and formatter for Q# files! Our feature branch is over here: https://github.com/microsoft/qsharp-compiler/tree/feature/qslint-hackathon. This should give us the foundation to start fleshing out full-featured auto formatting, but it's starting small :). We'd be happy to get any feedback, and will share more on this and other related issues once we have the results of our hackathon efforts!