Skip to content

Commit 849a18f

Browse files
authored
Merge branch 'main' into fix-size-labeler
2 parents 7289cab + 70ecfd2 commit 849a18f

5 files changed

Lines changed: 20 additions & 58 deletions

File tree

.editorconfig

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,20 @@ root = true
2121
# the same settings and need to be updated if changes are made to this file.
2222
[*]
2323
charset = utf-8
24+
indent_size = 4
2425
indent_style = space
2526
insert_final_newline = true
27+
max_line_length = 80
2628
spelling_language = en-US
2729
trim_trailing_whitespace = true
28-
max_line_length = 80
29-
30-
[{BUILD,*.BUILD,*.bzl,*.bazel,.bazelrc,WORKSPACE}]
31-
indent_size = 4
32-
33-
[{CMakeLists.txt,*.cmake}]
34-
indent_size = 4
3530

36-
[Dockerfile]
37-
indent_size = 4
31+
[{COMMIT_EDITMSG,MERGE_MSG,SQUASH_MSG,TAG_EDITMSG}]
32+
max_line_length = 72
3833

3934
[{Makefile,makefile,*.mk}]
4035
indent_style = tab
41-
indent_size = 4
36+
indent_size = 8
37+
tab_width = 8
4238

4339
[{*.cc,*.h}]
4440
indent_size = 2
@@ -47,15 +43,8 @@ indent_size = 2
4743
indent_size = 2
4844

4945
[*.py]
50-
indent_size = 4
5146
# This is the Black default line length.
5247
max_line_length = 88
5348

54-
[*.sh]
55-
indent_size = 4
56-
57-
[*.toml]
58-
indent_size = 4
59-
6049
[{*.yaml,*.yml,*.cff}]
6150
indent_size = 2

.github/workflows/ci.yaml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ jobs:
102102
steps:
103103
- name: Check out a copy of the git repository
104104
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105-
with:
106-
fetch-depth: 0
107105

108106
- name: Run hadolint on Dockerfiles
109107
continue-on-error: ${{inputs.soft-linting == 'true'}}
110108
env:
111-
hadolint_version: 'sha256:e9dbf5113239ef2bf696d20c8f28d3019a47c26a38c98b89344d3e2846c4d5f8'
109+
sha: 'sha256:e9dbf5113239ef2bf696d20c8f28d3019a47c26a38c98b89344d3e2846c4d5f8'
112110
run: |
113111
echo '::add-matcher::.github/problem-matchers/hadolint.json'
114-
find . -name Dockerfile -print0 | \
115-
xargs -0 -r docker run --rm -i -v "${PWD}:/app" -w /app \
116-
--entrypoint /bin/hadolint \
117-
ghcr.io/hadolint/hadolint@${{env.hadolint_version}}
112+
shopt -s globstar
113+
files=(**/Dockerfile*)
114+
if [[ ${#files[@]} -gt 0 ]]; then
115+
docker run --rm -v "${PWD}:/app" -w /app \
116+
ghcr.io/hadolint/hadolint@${{env.sha}} /bin/hadolint "${files[@]}"
117+
fi
118118
119119
shell-lint:
120120
name: Shell script lint checks
@@ -124,8 +124,6 @@ jobs:
124124
steps:
125125
- name: Check out a copy of the git repository
126126
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
127-
with:
128-
fetch-depth: 0
129127

130128
- name: Install problem matcher
131129
run: echo '::add-matcher::.github/problem-matchers/shellcheck.json'
@@ -147,8 +145,6 @@ jobs:
147145
steps:
148146
- name: Check out a copy of the git repository
149147
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
150-
with:
151-
fetch-depth: 0
152148

153149
- name: Install yamllint
154150
run: |
@@ -159,10 +155,7 @@ jobs:
159155
continue-on-error: ${{inputs.soft-linting == 'true'}}
160156
run: |
161157
echo "::add-matcher::.github/problem-matchers/yamllint.json"
162-
# shellcheck disable=SC2038
163-
find . -not -path '*.github/workflows/*' \
164-
'(' -name '*.yaml' -o -name '*.yml' ')' | \
165-
xargs yamllint -f github
158+
yamllint -f github . CITATION.cff
166159
167160
bazel-lint:
168161
name: Bazel build lint checks
@@ -172,8 +165,6 @@ jobs:
172165
steps:
173166
- name: Check out a copy of the git repository
174167
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
175-
with:
176-
fetch-depth: 0
177168

178169
- name: Install Buildifier
179170
uses: jbajic/setup-buildifier@c558ee05c6f74ab5753ff794516750b4aadac296 # v1
@@ -184,9 +175,7 @@ jobs:
184175
continue-on-error: ${{inputs.soft-linting == 'true'}}
185176
run: |
186177
echo '::add-matcher::.github/problem-matchers/buildifier.json'
187-
# shellcheck disable=SC2038
188-
find . -name 'BUILD' -o -name '*.bzl' -o -name 'WORKSPACE' | \
189-
xargs buildifier -mode=diff -lint=warn
178+
buildifier -mode=diff -lint=warn -r .
190179
191180
action-lint:
192181
name: GitHub Actions lint checks
@@ -196,8 +185,6 @@ jobs:
196185
steps:
197186
- name: Check out a copy of the git repository
198187
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
199-
with:
200-
fetch-depth: 0
201188

202189
- name: Run actionlint
203190
continue-on-error: ${{inputs.soft-linting == 'true'}}

.github/workflows/pr-labeler.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
label-pr-size:
4949
if: github.repository_owner == 'quantumlib'
5050
name: Update PR size labels
51-
runs-on: ubuntu-24.04
51+
runs-on: ubuntu-slim
5252
timeout-minutes: 5
5353
permissions:
5454
contents: read

.github/workflows/scorecard-scanner.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ on:
3232

3333
# Allow manual invocation.
3434
workflow_dispatch:
35-
inputs:
36-
debug:
37-
description: 'Run with debugging options'
38-
type: boolean
39-
default: true
4035

4136
concurrency:
4237
# Cancel any previously-started but still active runs on the same branch.
@@ -73,19 +68,10 @@ jobs:
7368

7469
- name: Upload results to code-scanning dashboard
7570
# yamllint disable rule:line-length
76-
uses: github/codeql-action/upload-sarif@ba454b8ab46733eb6145342877cd148270bb77ab # codeql-bundle-v2.23.5
71+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
7772
with:
7873
sarif_file: scorecard-results.sarif
7974

80-
- if: github.event.inputs.debug == true || runner.debug == true
81-
name: Upload results as artifacts to the workflow Summary page
82-
# yamllint disable rule:line-length
83-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
84-
with:
85-
name: Scorecard SARIF file
86-
path: scorecard-results.sarif
87-
retention-days: 5
88-
8975
# Scorecard currently (ver. 2.4.x) doesn't allow submissions from jobs having
9076
# steps that use "run:". To print to the summary, we need to use another job.
9177
write-summary:

qsimcirq/qsim_circuit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
from . import qsim
2121

22-
# List of parameter names that appear in valid Cirq protos.
23-
GATE_PARAMS = [
22+
# Set of parameter names that appear in valid Cirq protos.
23+
GATE_PARAMS = {
2424
"exponent",
2525
"phase_exponent",
2626
"global_shift",
@@ -29,7 +29,7 @@
2929
"axis_phase_exponent",
3030
"phi",
3131
"theta",
32-
]
32+
}
3333

3434

3535
def _translate_ControlledGate(gate: cirq.ControlledGate):

0 commit comments

Comments
 (0)