Skip to content

Commit 2b2c9b1

Browse files
authored
Add gitattributes file to adjust linguist settings (#13977)
Github uses a ruby library linguist [1] for detecting the languages used in a github repository. The detection this library does is not perfect as it relies on file extensions and obviously it doesn't know about context around certain files. Linguist provides tools for correcting these issues so the reported split of languages in a repository is more accurate. This commit adds a .gitattributes file to Qiskit to adjust how linguist interprets some files to provide a better measurement of the languages used in the repository. This involves three main changes: 1. Marking the qasm files in test/benchmarks/qasm as generated code as they're all generated output for measuring qasm parsing time or to have a deterministic circuit definition. These aren't source files that should be counted as part of the language breakdown. 2. Marking the visualization text references in LaTeX and txt files as generated, as they're generated from the visualization output to serve as a comparison for testing. 3. Marking the qasm libraries using the *inc extension as OpenQASM not C++. With these three changes the languages used by qiskit is a better reflection of the current state of the repository. [1] https://github.com/github-linguist/linguist
1 parent 2fe67f0 commit 2b2c9b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Exclude benchmark qasm and reference text:
2+
test/benchmarks/qasm/** linguist-generated
3+
test/python/visualization/references/*.tex linguist-generated
4+
test/python/visualization/references/*.txt linguist-generated
5+
# Mark qasm libs as qasm not c++
6+
*.inc linguist-language=OpenQASM

0 commit comments

Comments
 (0)