Skip to content
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 flake8 workflow #2

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: flake8 Lint

on: [push, pull_request]

jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
max-line-length: "120"
8 changes: 4 additions & 4 deletions test/test_metric_values.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unittest
from dataclasses import dataclass
from typing import Dict, Any, Sequence, List
from metric_values import MetricValue, MetricValueCounter, MetricValueGauge
from prometheus_client import Counter, Gauge
from metric_values import MetricValueCounter, MetricValueGauge
from prometheus_client import Gauge


@dataclass
Expand All @@ -21,7 +21,7 @@ def inc(self, val):
self.last_inc = val

def labels(self, **labelkwargs: Any):
label_values = tuple(str(labelkwargs[l]) for l in self.__label_names)
label_values = tuple(str(labelkwargs[label]) for label in self.__label_names)

if label_values in self.child_counters:
return self.child_counters[label_values]
Expand All @@ -45,7 +45,7 @@ def inc(self, val):
self.last_inc = val

def labels(self, **labelkwargs: Any):
label_values = tuple(str(labelkwargs[l]) for l in self.__label_names)
label_values = tuple(str(labelkwargs[label]) for label in self.__label_names)

if label_values in self.child_gauges:
return self.child_gauges[label_values]
Expand Down