Skip to content

Commit

Permalink
fix: Resolved some security issues flagged by CodeQL (#4)
Browse files Browse the repository at this point in the history
* Update README.md with readthedocs link

Signed-off-by: Shashank P <[email protected]>

* Updated documentation status for stable version.

Signed-off-by: Shashank P <[email protected]>

* fix: updated tekhsi_connect.py by removing multiple import errors.

Removed duplicate imports.
Prefixed unused term for unused global variables.

Signed-off-by: Shashank P <[email protected]>

* fix: optimized imports in test_client.py

Signed-off-by: Shashank P <[email protected]>

* fix: replaced unused variable with underscore in simple_read.py

Signed-off-by: Shashank P <[email protected]>

* fix: removed unused variable in tek_hsi_connect.py

Signed-off-by: Shashank P <[email protected]>

* fix: Updated macros.py to remove black formatting on basic_usage

Signed-off-by: Shashank P <[email protected]>

---------

Signed-off-by: Shashank P <[email protected]>
  • Loading branch information
u625355 authored Sep 9, 2024
1 parent 73dd3e4 commit a760e0b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| **Testing** | [![Code testing status](https://github.com/tektronix/TekHSI/actions/workflows/test-code.yml/badge.svg?branch=main)](https://github.com/tektronix/TekHSI/actions/workflows/test-code.yml) [![Docs testing status](https://github.com/tektronix/TekHSI/actions/workflows/test-docs.yml/badge.svg?branch=main)](https://github.com/tektronix/TekHSI/actions/workflows/test-docs.yml) [![Coverage status](https://codecov.io/gh/tektronix/TekHSI/branch/main/graph/badge.svg)](https://codecov.io/gh/tektronix/TekHSI) |
| **Code Quality** | [![CodeQL status](https://github.com/tektronix/TekHSI/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/tektronix/TekHSI/actions/workflows/codeql-analysis.yml) [![CodeFactor grade](https://www.codefactor.io/repository/github/tektronix/TekHSI/badge)](https://www.codefactor.io/repository/github/tektronix/TekHSI) [![pre-commit status](https://results.pre-commit.ci/badge/github/tektronix/TekHSI/main.svg)](https://results.pre-commit.ci/latest/github/tektronix/TekHSI/main) |
| **Package** | [![PyPI: Package status](https://img.shields.io/pypi/status/TekHSI?logo=pypi)](https://pypi.org/project/TekHSI/) [![PyPI: Latest release version](https://img.shields.io/pypi/v/TekHSI?logo=pypi)](https://pypi.org/project/TekHSI/) [![PyPI: Supported Python versions](https://img.shields.io/pypi/pyversions/TekHSI?logo=python)](https://pypi.org/project/TekHSI/) [![PyPI: Downloads](https://pepy.tech/badge/TekHSI)](https://pepy.tech/project/TekHSI) [![License: Apache 2.0](https://img.shields.io/pypi/l/TekHSI)](https://github.com/tektronix/TekHSI/blob/main/LICENSE.md) [![Package build status](https://github.com/tektronix/TekHSI/actions/workflows/package-build.yml/badge.svg?branch=main)](https://github.com/tektronix/TekHSI/actions/workflows/package-build.yml) [![PyPI upload status](https://github.com/tektronix/TekHSI/actions/workflows/package-release.yml/badge.svg?branch=main)](https://github.com/tektronix/TekHSI/actions/workflows/package-release.yml) |
| **Documentation** | [![ReadtheDocs Status](https://img.shields.io/readthedocs/TekHSI/stable?logo=readthedocs)](https://TekHSI.readthedocs.io/stable) |
| **Documentation** | [![ReadtheDocs Status](https://img.shields.io/readthedocs/TekHSI/stable?logo=readthedocs)](https://tekhsi.readthedocs.io/stable) |
| **Code Style** | [![Test style: pytest](https://img.shields.io/badge/test%20style-pytest-blue)](https://github.com/pytest-dev/pytest) [![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-black)](https://docs.astral.sh/ruff/formatter/) [![Docstring style: google](https://img.shields.io/badge/docstring%20style-google-tan)](https://google.github.io/styleguide/pyguide.html) |
| **Linting** | [![pre-commit enabled](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Docstring formatter: docformatter](https://img.shields.io/badge/docstring%20formatter-docformatter-tan)](https://github.com/PyCQA/docformatter)[![Linter: pylint](https://img.shields.io/badge/linter-pylint-purple)](https://github.com/pylint-dev/pylint) |

Expand Down
4 changes: 3 additions & 1 deletion docs/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
),
"index.md": ((" Scopes ", r" [Scopes](default:Scope) "),),
}
FILES_TO_REMOVE_BLACK_FORMATTER_DISABLE_COMMENT = {}
FILES_TO_REMOVE_BLACK_FORMATTER_DISABLE_COMMENT = {
"basic_usage.md",
}


####################################################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

ax.set_ylim(min_val - extra, max_val + extra)
ax.set_xlim(np.min(horizontal_data), np.max(horizontal_data))
(line,) = ax.plot(horizontal_data, vertical_data)
(_,) = ax.plot(horizontal_data, vertical_data)

# Display the plot
plt.show()
4 changes: 1 addition & 3 deletions src/tekhsi/tek_hsi_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from atexit import register
from enum import Enum
from contextlib import contextmanager

from typing import List, Optional, Dict

Expand Down Expand Up @@ -214,7 +213,7 @@ def verbose(self, value: bool):
################################################################################################
# Context Manager Methods
################################################################################################
@contextmanager
@contextlib.contextmanager
def access_data(self, on: AcqWaitOn = AcqWaitOn.NewData, after: float = -1):
"""Grants access to data.
Expand Down Expand Up @@ -650,7 +649,6 @@ def _read_waveform(self, header: WaveformHeader):
)

sample_index = 0
data_size = header.sourcewidth
request = WaveformRequest(sourcename=header.sourcename, chunksize=self.chunksize)
response_iterator = self.native.GetWaveform(request)
dt = None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy as np
import pytest
from tm_data_types import AnalogWaveform, IQWaveform, DigitalWaveform, Waveform
from tm_data_types import AnalogWaveform, IQWaveform, DigitalWaveform

from tekhsi.helpers import print_with_timestamp
from tekhsi.tek_hsi_connect import TekHSIConnect, AcqWaitOn
Expand Down

0 comments on commit a760e0b

Please sign in to comment.