Skip to content

Commit

Permalink
Add CodeQL workflow for GitHub code scanning (#699)
Browse files Browse the repository at this point in the history
* Add CodeQL workflow for GitHub code scanning

* fix codeql error

Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com>
Co-authored-by: Co Quach <daico007@gmail.com>
  • Loading branch information
3 people authored Dec 7, 2022
1 parent 6bcdfcc commit fe321e2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "41 4 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ python ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
1 change: 0 additions & 1 deletion gmso/formats/gsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ def _write_dihedral_information(gsd_snapshot, top):

def _prepare_box_information(top):
"""Prepare the box information for writing to gsd."""
lx = ly = lz = xy = xz = yz = 0.0
if allclose_units(
top.box.angles, np.array([90, 90, 90]) * u.degree, rtol=1e-5, atol=1e-8
):
Expand Down
3 changes: 3 additions & 0 deletions gmso/tests/parameterization/test_parameterization_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ def test_hierarchical_mol_structure(
}
elif match_ff_by == "group":
ff_dict = {"sol1": oplsaa_gmso, "sol2": tip3p}
else:
raise ValueError("Unexpected value provided match_ff_by.")

apply(
top,
ff_dict,
Expand Down
2 changes: 1 addition & 1 deletion gmso/utils/nx_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def get_edges(networkx_graph, atom_name1, atom_name2):
for nodes in list(networkx_graph.edges.items()):
if nodes[1]["connection"].bond_type is None:
selectable_dict = create_dict_of_labels_for_edges(
selectable_dict, edge
selectable_dict, nodes[0]
)
mia_bond_flag = 1
if not mia_bond_flag:
Expand Down

0 comments on commit fe321e2

Please sign in to comment.