diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..b13159a --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 120 +exclude = .git,__pycache__,venv \ No newline at end of file diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a14ee8c..56b0aeb 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -6,15 +6,46 @@ on: - '*' jobs: + lint: + name: Python Linux (flake8) + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Run Lint + run: flake8 --verbose --color auto --count --statistics --format=json --output-file=flake8-report.json || echo "::set-output name=flake8_failed::true" + continue-on-error: true + + - name: Upload Report + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: flake8-report + path: flake8-report.json + build_and_test: + name: Build and Test runs-on: ubuntu-latest + needs: lint steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/pyconfigurationmanager/__init__.py b/pyconfigurationmanager/__init__.py index 9f32694..535a36c 100644 --- a/pyconfigurationmanager/__init__.py +++ b/pyconfigurationmanager/__init__.py @@ -28,11 +28,11 @@ ] __author__ = "coldsofttech" __description__ = """ -The pyconfigurationmanager package provides a set of utilities for managing configuration settings in -Python applications. It includes classes and functions for loading configuration data from files, +The pyconfigurationmanager package provides a set of utilities for managing configuration settings in +Python applications. It includes classes and functions for loading configuration data from files, auditing configuration changes, and ensuring secure access to configuration files. """ __name__ = "pyconfigurationmanager" -__version__ = "0.1.0" +__version__ = "0.1.1" from pyconfigurationmanager.__main__ import ConfigurationManager, ConfigurationManagerError diff --git a/tests/utilityclass.py b/tests/utilityclass.py index 411a83a..72a8489 100644 --- a/tests/utilityclass.py +++ b/tests/utilityclass.py @@ -43,12 +43,12 @@ def delete_config(file_name: str) -> None: command = f'icacls "{file_name}" /inheritance:r /grant:r "%USERNAME%:F"' try: subprocess.run(command, shell=True, check=True) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError: pass try: os.remove(file_name) - except (PermissionError, OSError, FileNotFoundError) as e: + except (PermissionError, OSError, FileNotFoundError): pass @staticmethod @@ -78,10 +78,10 @@ def generate_config(file_name: str, limited_permissions: bool = True, invalid_js try: for command in commands: subprocess.run(command, shell=True, check=True) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError: pass elif platform.system().lower() == 'linux': try: os.chmod(file_name, 0o400) - except (PermissionError, OSError) as e: + except (PermissionError, OSError): pass