Skip to content
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
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main, master, develop, dev, 2.0.0]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop, dev, 2.0.0 ]
schedule:
- cron: '26 13 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Build and lint
name: Lint and build
on:
push:
branches:
- main
- master
- 2.0.0
paths:
- '**.py'
- '**.pyi'
- '**.ui'
pull_request:
branches:
- main
- master
- dev
- dev*
paths:
- '**.py'
- '**.pyi'
- '**.ui'
jobs:
Pyright:
runs-on: windows-latest
Expand Down Expand Up @@ -54,7 +62,7 @@ jobs:
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
run: pylint --reports=y --output-format=colorized $(git ls-files '**/*.py*')
Bandit:
Flake8:
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -72,8 +80,8 @@ jobs:
pip install -r "scripts/requirements.txt"
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
run: bandit -n 1 --severity-level medium --recursive src
Flake8:
run: flake8
Bandit:
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -91,7 +99,7 @@ jobs:
pip install -r "scripts/requirements.txt"
- run: scripts/compile_resources.bat
- name: Analysing the code with ${{ job.name }}
run: flake8
run: bandit -n 1 --severity-level medium --recursive src
Build:
runs-on: windows-latest
strategy:
Expand Down
5 changes: 3 additions & 2 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"default": true,
"MD025": false,
"MD013": false
"MD001": false,
"MD013": false,
"MD025": false
}
14 changes: 13 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
// Keep in alphabetical order
{
"recommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"ms-python.python",
"ms-python.vscode-pylance",
"pkief.material-icon-theme",
"shardulm94.trailing-spaces",
"sonarsource.sonarlint-vscode"
],
"unwantedRecommendations": [
// VSCode has implemented an optimized version
"coenraads.bracket-pair-colorizer",
"coenraads.bracket-pair-colorizer-2",
// Lots of conflicts
"esbenp.prettier-vscode",
// Replaced by ESLint
"eg2.tslint",
"ms-vscode.vscode-typescript-tslint-plugin",
// Obsoleted by Pylance
"ms-pyright.pyright",
"esbenp.prettier-vscode"
// The ESLint plugin is sufficient in JS-only projects
"sonarsource.sonarlint-vscode",
]
}
62 changes: 37 additions & 25 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,11 @@
},
"editor.detectIndentation": false,
"editor.tabSize": 2,
"[python]": {
"editor.tabSize": 4,
"editor.rulers": [
72, // PEP8-17 docstrings
// 79, // PEP8-17 default max
// 88, // Black default
99, // PEP8-17 acceptable max
120, // Our hard rule
]
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.markdownlint": true,
},
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintCategorySeverity.convention": "Warning",
"python.linting.pylintCategorySeverity.refactor": "Warning",
"python.linting.flake8Enabled": true,
"python.linting.flake8CategorySeverity.E": "Warning",
// PyRight obsoletes mypy
"python.linting.mypyEnabled": false,
// Is already wrapped by Flake8, prospector and pylama
"python.linting.pycodestyleEnabled": false,
// Just another wrapper, use Flake8 OR this
"python.linting.prospectorEnabled": false,
// Just another wrapper, use Flake8 OR this
"python.linting.pylamaEnabled": false,
"python.linting.banditEnabled": true,
"files.insertFinalNewline": true,
"trailing-spaces.includeEmptyLines": true,
"trailing-spaces.trimOnSave": true,
Expand Down Expand Up @@ -67,4 +42,41 @@
"**/*.code-search": true,
"typings": true,
},
"[python]": {
"editor.tabSize": 4,
"editor.rulers": [
72, // PEP8-17 docstrings
// 79, // PEP8-17 default max
// 88, // Black default
99, // PEP8-17 acceptable max
120, // Our hard rule
]
},
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintCategorySeverity.convention": "Warning",
"python.linting.pylintCategorySeverity.refactor": "Warning",
"python.linting.flake8Enabled": true,
"python.linting.flake8CategorySeverity.E": "Warning",
// PyRight obsoletes mypy
"python.linting.mypyEnabled": false,
// Is already wrapped by Flake8, prospector and pylama
"python.linting.pycodestyleEnabled": false,
// Just another wrapper, use Flake8 OR this
"python.linting.prospectorEnabled": false,
// Just another wrapper, use Flake8 OR this
"python.linting.pylamaEnabled": false,
"python.linting.banditEnabled": true,
// Copy those over to your user settings
"sonarlint.rules": {
"python:S1192": {
"level": "off"
},
"python:S3776": {
"level": "off"
},
"python:S107": {
"level": "off"
},
},
}
4 changes: 4 additions & 0 deletions PyInstaller/hooks/hook-requests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from PyInstaller.utils.hooks import collect_data_files

# Get the cacert.pem
datas = collect_data_files("certifi")
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | :-------: |
| main | :white_check_mark: |
| dev* | :white_check_mark: |
| everything else | WIP branches, security support may be lacking |

## Reporting a Vulnerability

This is a small project, maintained by a few volunteers of the community. Just open up an issue, be clear, explain why it's a vulnerability as well as your recommendations to fix it. Please provide sources if possible.
28 changes: 14 additions & 14 deletions res/update_checker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
<widget class="QLabel" name="labelUpdateStatus">
<property name="geometry">
<rect>
<x>17</x>
<x>20</x>
<y>10</y>
<width>281</width>
<width>218</width>
<height>16</height>
</rect>
</property>
Expand All @@ -62,13 +62,13 @@
</sizepolicy>
</property>
<property name="text">
<string/>
<string>There is an update available for AutoSplit.</string>
</property>
</widget>
<widget class="QLabel" name="labelCurrentVersion">
<property name="geometry">
<rect>
<x>17</x>
<x>20</x>
<y>30</y>
<width>91</width>
<height>16</height>
Expand All @@ -81,7 +81,7 @@
<widget class="QLabel" name="labelLatestVersion">
<property name="geometry">
<rect>
<x>17</x>
<x>20</x>
<y>50</y>
<width>81</width>
<height>16</height>
Expand All @@ -94,14 +94,14 @@
<widget class="QLabel" name="labelGoToDownload">
<property name="geometry">
<rect>
<x>17</x>
<y>76</y>
<width>241</width>
<x>20</x>
<y>80</y>
<width>119</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string/>
<string>Open download page?</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonLeft">
Expand All @@ -117,7 +117,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
<string>Open</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonRight">
Expand All @@ -130,7 +130,7 @@
</rect>
</property>
<property name="text">
<string/>
<string>Later</string>
</property>
</widget>
<widget class="QLabel" name="labelCurrentVersionNumber">
Expand Down Expand Up @@ -162,9 +162,9 @@
<widget class="QCheckBox" name="checkBoxDoNotAskMeAgain">
<property name="geometry">
<rect>
<x>17</x>
<y>100</y>
<width>141</width>
<x>20</x>
<y>102</y>
<width>131</width>
<height>20</height>
</rect>
</property>
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CALL "%~p0compile_resources.bat"
pyinstaller -w -F --icon=res\icon.ico "%~p0..\src\AutoSplit.py"
pyinstaller --windowed --onefile --additional-hooks-dir=Pyinstaller\hooks --icon=res\icon.ico "%~p0..\src\AutoSplit.py"
6 changes: 3 additions & 3 deletions scripts/lint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pyright
echo "`nRunning Pylint..."
pylint --score=n --output-format=colorized $(git ls-files '**/*.py*')

echo "`nRunning Bandit..."
bandit -f custom --silent --recursive src

echo "`nRunning Flake8..."
flake8

echo "`nRunning Bandit..."
bandit -f custom --silent --recursive src
17 changes: 9 additions & 8 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
# Creating AutoSplit.exe with PyInstaller: .\scripts\build.bat
#
# Dependencies:
ImageHash
keyboard
numpy>=1.22.0rc1
opencv-python<=4.5.3.56 # https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/110
packaging
Pillow
PyQt6
PyQt6-tools
PySide6
Pillow
ImageHash
pywin32
keyboard
packaging
pyautogui
pywin32
requests
# Linting and Types
pywin32-stubs
types-requests
bandit
flake8
flake8-quotes
pylint
bandit
pywin32-stubs
types-requests
#
# Comment this out if you don't want to build AutoSplit.exe:
PyInstaller
Loading