-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add .editorconfig #6033
Add .editorconfig #6033
Conversation
indent_size = 4 | ||
|
||
# Javascript | ||
[*.{js,json}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have js
files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Do you think its a bad idea to specify a default indentation for such extension even if we currently don't have any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually do have a tiny bit of js in the repo. Not as standalone files though, there is some javascript embedded in the html template files used for the docs theme. Although those files aren't pure html either as it's actually a jinja2 template for an html file. Not that this is really relevant for this.
indent_size = 4 | ||
|
||
# Javascript | ||
[*.{js,json}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think all our json
files are not human-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these are: https://github.com/Qiskit/qiskit-terra/tree/master/qiskit/schemas (they're at least hand edited frequently) although all the schemas are deprecated and will be removed soon.
All the json files in https://github.com/Qiskit/qiskit-terra/tree/master/qiskit/test/mock/backends are machine generated and not expected to be editted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the schema files are inconsistently indented, but lean more towards 4-space than 2-space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any preference for 2-vs-4 spaces for json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably go 4 spaces just to be consistent with the python style we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, since this was originally opened the schema files finished their deprecation cycle and the schema files have been removed from terra. That being said I ran tokei
to find where we still have json files committed in the repo and there are 2 types. The first are api payload snapshots for the fake backends which are machine generated. The second are the user style guides which are hand generated.
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
Language Files Lines Code Comments Blanks
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
JSON 105 1121 1121 0 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
./qiskit/visualization/styles/iqx-dark.json 202 202 0 0
./qiskit/visualization/styles/default.json 202 202 0 0
./qiskit/visualization/styles/iqx.json 202 202 0 0
./qiskit/visualization/styles/bw.json 202 202 0 0
./qiskit/test/mock/backends/rochester/conf_rochester.json 1 1 0 0
./qiskit/test/mock/backends/santiago/conf_santiago.json 1 1 0 0
./qiskit/test/mock/backends/quito/conf_quito.json 1 1 0 0
./qiskit/test/mock/backends/ourense/conf_ourense.json 1 1 0 0
./qiskit/test/mock/backends/rome/props_rome.json 1 1 0 0
./qiskit/test/mock/backends/jakarta/props_jakarta.json 1 1 0 0
./qiskit/test/mock/backends/yorktown/props_yorktown.json 1 1 0 0
./qiskit/test/mock/backends/quito/props_quito.json 1 1 0 0
./qiskit/test/mock/backends/valencia/props_valencia.json 1 1 0 0
./qiskit/test/mock/backends/ourense/props_ourense.json 1 1 0 0
./qiskit/test/mock/backends/jakarta/conf_jakarta.json 1 1 0 0
./qiskit/test/mock/backends/london/props_london.json 1 1 0 0
./qiskit/test/mock/backends/lagos/conf_lagos.json 1 1 0 0
./qiskit/test/mock/backends/valencia/defs_valencia.json 1 1 0 0
./qiskit/test/mock/backends/johannesburg/conf_johannesburg.json 1 1 0 0
./qiskit/test/mock/backends/cambridge/conf_cambridge.json 1 1 0 0
./qiskit/test/mock/backends/rome/defs_rome.json 1 1 0 0
./qiskit/test/mock/backends/santiago/defs_santiago.json 1 1 0 0
./qiskit/test/mock/backends/quito/defs_quito.json 1 1 0 0
./qiskit/test/mock/backends/burlington/conf_burlington.json 1 1 0 0
./qiskit/test/mock/backends/tokyo/props_tokyo.json 1 1 0 0
./qiskit/test/mock/backends/casablanca/conf_casablanca.json 1 1 0 0
./qiskit/test/mock/backends/yorktown/defs_yorktown.json 1 1 0 0
./qiskit/test/mock/backends/burlington/props_burlington.json 1 1 0 0
./qiskit/test/mock/backends/bogota/props_bogota.json 1 1 0 0
./qiskit/test/mock/backends/bogota/conf_bogota.json 1 1 0 0
./qiskit/test/mock/backends/lima/conf_lima.json 1 1 0 0
./qiskit/test/mock/backends/essex/conf_essex.json 1 1 0 0
./qiskit/test/mock/backends/athens/props_athens.json 1 1 0 0
./qiskit/test/mock/backends/belem/props_belem.json 1 1 0 0
./qiskit/test/mock/backends/boeblingen/conf_boeblingen.json 1 1 0 0
./qiskit/test/mock/backends/athens/conf_athens.json 1 1 0 0
./qiskit/test/mock/backends/bogota/defs_bogota.json 1 1 0 0
./qiskit/test/mock/backends/paris/conf_paris.json 1 1 0 0
./qiskit/test/mock/backends/belem/conf_belem.json 1 1 0 0
./qiskit/test/mock/backends/cambridge/props_cambridge.json 1 1 0 0
./qiskit/test/mock/backends/cambridge/props_cambridge_alt.json 1 1 0 0
./qiskit/test/mock/backends/armonk/props_armonk.json 1 1 0 0
./qiskit/test/mock/backends/armonk/conf_armonk.json 1 1 0 0
./qiskit/test/mock/backends/armonk/defs_armonk.json 1 1 0 0
./qiskit/test/mock/backends/casablanca/props_casablanca.json 1 1 0 0
./qiskit/test/mock/backends/boeblingen/props_boeblingen.json 1 1 0 0
./qiskit/test/mock/backends/poughkeepsie/props_poughkeepsie.json 1 1 0 0
./qiskit/test/mock/backends/almaden/conf_almaden.json 1 1 0 0
./qiskit/test/mock/backends/mumbai/conf_mumbai.json 1 1 0 0
./qiskit/test/mock/backends/montreal/conf_montreal.json 1 1 0 0
./qiskit/test/mock/backends/athens/defs_athens.json 1 1 0 0
./qiskit/test/mock/backends/lima/defs_lima.json 1 1 0 0
./qiskit/test/mock/backends/belem/defs_belem.json 1 1 0 0
./qiskit/test/mock/backends/melbourne/conf_melbourne.json 1 1 0 0
./qiskit/test/mock/backends/jakarta/defs_jakarta.json 1 1 0 0
./qiskit/test/mock/backends/almaden/props_almaden.json 1 1 0 0
./qiskit/test/mock/backends/lagos/props_lagos.json 1 1 0 0
./qiskit/test/mock/backends/toronto/conf_toronto.json 1 1 0 0
./qiskit/test/mock/backends/valencia/conf_valencia.json 1 1 0 0
./qiskit/test/mock/backends/london/conf_london.json 1 1 0 0
./qiskit/test/mock/backends/rochester/props_rochester.json 1 1 0 0
./qiskit/test/mock/backends/sydney/props_sydney.json 1 1 0 0
./qiskit/test/mock/backends/manhattan/conf_manhattan.json 1 1 0 0
./qiskit/test/mock/backends/singapore/conf_singapore.json 1 1 0 0
./qiskit/test/mock/backends/rome/conf_rome.json 1 1 0 0
./qiskit/test/mock/backends/manila/conf_manila.json 1 1 0 0
./qiskit/test/mock/backends/mumbai/props_mumbai.json 1 1 0 0
./qiskit/test/mock/backends/manila/props_manila.json 1 1 0 0
./qiskit/test/mock/backends/guadalupe/conf_guadalupe.json 1 1 0 0
./qiskit/test/mock/backends/vigo/conf_vigo.json 1 1 0 0
./qiskit/test/mock/backends/paris/props_paris.json 1 1 0 0
./qiskit/test/mock/backends/santiago/props_santiago.json 1 1 0 0
./qiskit/test/mock/backends/guadalupe/props_guadalupe.json 1 1 0 0
./qiskit/test/mock/backends/melbourne/props_melbourne.json 1 1 0 0
./qiskit/test/mock/backends/boeblingen/defs_boeblingen.json 1 1 0 0
./qiskit/test/mock/backends/toronto/props_toronto.json 1 1 0 0
./qiskit/test/mock/backends/montreal/props_montreal.json 1 1 0 0
./qiskit/test/mock/backends/brooklyn/props_brooklyn.json 1 1 0 0
./qiskit/test/mock/backends/poughkeepsie/conf_poughkeepsie.json 1 1 0 0
./qiskit/test/mock/backends/sydney/conf_sydney.json 1 1 0 0
./qiskit/test/mock/backends/singapore/props_singapore.json 1 1 0 0
./qiskit/test/mock/backends/tenerife/props_tenerife.json 1 1 0 0
./qiskit/test/mock/backends/vigo/props_vigo.json 1 1 0 0
./qiskit/test/mock/backends/lima/props_lima.json 1 1 0 0
./qiskit/test/mock/backends/essex/props_essex.json 1 1 0 0
./qiskit/test/mock/backends/yorktown/conf_yorktown.json 1 1 0 0
./qiskit/test/mock/backends/mumbai/defs_mumbai.json 1 1 0 0
./qiskit/test/mock/backends/paris/defs_paris.json 1 1 0 0
./qiskit/test/mock/backends/sydney/defs_sydney.json 1 1 0 0
./qiskit/test/mock/backends/manila/defs_manila.json 1 1 0 0
./qiskit/test/mock/backends/brooklyn/conf_brooklyn.json 1 1 0 0
./qiskit/test/mock/backends/casablanca/defs_casablanca.json 1 1 0 0
./qiskit/test/mock/backends/johannesburg/props_johannesburg.json 1 1 0 0
./qiskit/test/mock/backends/montreal/defs_montreal.json 1 1 0 0
./qiskit/test/mock/backends/manhattan/defs_manhattan.json 1 1 0 0
./qiskit/test/mock/backends/brooklyn/defs_brooklyn.json 1 1 0 0
./qiskit/test/mock/backends/toronto/defs_toronto.json 1 1 0 0
./qiskit/test/mock/backends/poughkeepsie/defs_poughkeepsie.json 1 1 0 0
./qiskit/test/mock/backends/lagos/defs_lagos.json 1 1 0 0
./test/ipynb/mpl/circuit/user_style.json 213 213 0 0
./qiskit/test/mock/backends/guadalupe/defs_guadalupe.json 1 1 0 0
./qiskit/test/mock/backends/manhattan/props_manhattan.json 1 1 0 0
./qiskit/test/mock/backends/johannesburg/defs_johannesburg.json 1 1 0 0
./qiskit/test/mock/backends/singapore/defs_singapore.json 1 1 0 0
./qiskit/test/mock/backends/almaden/defs_almaden.json 1 1 0 0
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
Total 105 1121 1121 0 0
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================```
Co-authored-by: Luciano Bello <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM in it's current form. While I probably won't end up using this in vim (since I don't have the plugin installed), given the list of editors which support it out of the box and the current most popular editors out there seem to be on that list, it's good to have this in place to set defaults (although I'd be surprised if any editor used different defaults especially for python). Sorry this fell through the cracks.
Pull Request Test Coverage Report for Build 1774289589
💛 - Coveralls |
EditorConfig sets project-wide editor defaults: https://EditorConfig.org
Line ending, tab-width, etc, etc
A small quality-of-life improvement for new contributors if they happen to be using one of the many compatible editors.