diff --git a/.github/workflows/ulwgl-protonfixes.yml b/.github/workflows/ulwgl-protonfixes.yml new file mode 100644 index 00000000..cf3ce52d --- /dev/null +++ b/.github/workflows/ulwgl-protonfixes.yml @@ -0,0 +1,35 @@ +name: ULWGL-protonfixes workflow + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + # The Steam Runtime platform (sniper) uses Python 3.9 + python-version: '3.9' + - name: Install dependencies + run: | + sudo apt-get install shellcheck + python3 -m pip install --upgrade pip + pip install pylint + - name: Lint with Shellcheck + run: | + shellcheck tools/lint.sh tools/check-links.sh + - name: Check symbolic links + run: | + bash tools/check-links.sh + - name: Lint with Pylint + run: | + bash tools/lint.sh diff --git a/.pylintrc b/.pylintrc deleted file mode 100755 index aee2e3b7..00000000 --- a/.pylintrc +++ /dev/null @@ -1,432 +0,0 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,similarities,fixme,too-many-branches,c-extension-no-member,literal-comparison,no-self-use,pointless-string-statement - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - - -[BASIC] - -# Naming hint for argument names -argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct argument names -argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for attribute names -attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct attribute names -attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata - -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ - -# Regular expression matching correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ - -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming hint for function names -function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct function names -function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Good variable names which should always be accepted, separated by a comma -good-names=i,j,k,ex,Run,_ - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - -# Naming hint for method names -method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct method names -method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming hint for variable names -variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct variable names -variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME,XXX,TODO - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=yes - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[SPELLING] - -# Spelling dictionary name. Available dictionaries: en_US (myspell), en_GB -# (myspell), en_AG (myspell), en_AU (myspell), en_BS (myspell), en_BW -# (myspell), en_BZ (myspell), en_CA (myspell), en_DK (myspell), en_GH -# (myspell), en_HK (myspell), en_IE (myspell), en_IN (myspell), en_JM -# (myspell), en_MW (myspell), en_NA (myspell), en_NG (myspell), en_NZ -# (myspell), en_PH (myspell), en_SG (myspell), en_TT (myspell), en_ZA -# (myspell), en_ZM (myspell), en_ZW (myspell), pl_PL (myspell), fr_BE -# (myspell), fr_CA (myspell), fr_CH (myspell), fr_FR (myspell), fr_LU -# (myspell), fr_MC (myspell). -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members=env,dlloverrides,wine_path,bindir,config.* - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=optparse,tkinter.tix - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/gamefixes-gog/ulwgl-1228964594.py b/gamefixes-gog/ulwgl-1228964594.py index 0d2a4007..a169c35d 100644 --- a/gamefixes-gog/ulwgl-1228964594.py +++ b/gamefixes-gog/ulwgl-1228964594.py @@ -5,8 +5,6 @@ from protonfixes import util def main(): - """ """ - # Fix display issues util.set_environment('MESA_EXTENSION_MAX_YEAR', '2003') util.set_environment('__GL_ExtensionStringVersion', '17700') diff --git a/gamefixes-gog/ulwgl-22610.py b/gamefixes-gog/ulwgl-22610.py index 56d33de8..362f774e 100755 --- a/gamefixes-gog/ulwgl-22610.py +++ b/gamefixes-gog/ulwgl-22610.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('physx') diff --git a/gamefixes-gog/ulwgl-22650.py b/gamefixes-gog/ulwgl-22650.py index 5e597344..453d1650 100755 --- a/gamefixes-gog/ulwgl-22650.py +++ b/gamefixes-gog/ulwgl-22650.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('physx') diff --git a/gamefixes-gog/ulwgl-22670.py b/gamefixes-gog/ulwgl-22670.py index 9a9420e0..ecfd7673 100755 --- a/gamefixes-gog/ulwgl-22670.py +++ b/gamefixes-gog/ulwgl-22670.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('physx') diff --git a/gamefixes-gog/ulwgl-wheeloftime.py b/gamefixes-gog/ulwgl-wheeloftime.py index f6af1664..f26b18aa 100644 --- a/gamefixes-gog/ulwgl-wheeloftime.py +++ b/gamefixes-gog/ulwgl-wheeloftime.py @@ -6,4 +6,4 @@ from protonfixes import util def main(): - util.winedll_override('ddraw', 'n,b') # GOG's dxcfg \ No newline at end of file + util.winedll_override('ddraw', 'n,b') # GOG's dxcfg diff --git a/gamefixes-steam/10220.py b/gamefixes-steam/10220.py index e1cd6459..a7268e7b 100644 --- a/gamefixes-steam/10220.py +++ b/gamefixes-steam/10220.py @@ -12,4 +12,4 @@ def main(): util.protontricks('verdana') util.protontricks('trebuchet') util.protontricks('arial') - util.protontricks('tahoma') \ No newline at end of file + util.protontricks('tahoma') diff --git a/gamefixes-steam/105400.py b/gamefixes-steam/105400.py index c612d4d0..3d4e9161 100755 --- a/gamefixes-steam/105400.py +++ b/gamefixes-steam/105400.py @@ -6,7 +6,6 @@ import os import shutil -from pathlib import Path from protonfixes import util from protonfixes.logger import log diff --git a/gamefixes-steam/1056640.py b/gamefixes-steam/1056640.py index edd55351..07c82681 100755 --- a/gamefixes-steam/1056640.py +++ b/gamefixes-steam/1056640.py @@ -5,8 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.set_environment('WINE_NO_OPEN_FILE_SEARCH','pso2_bin/data') - diff --git a/gamefixes-steam/1063730.py b/gamefixes-steam/1063730.py index c8181207..5bccd02e 100755 --- a/gamefixes-steam/1063730.py +++ b/gamefixes-steam/1063730.py @@ -2,9 +2,6 @@ """ #pylint: disable=C0103 -import glob -import os -import subprocess from protonfixes import util def main(): @@ -12,4 +9,3 @@ def main(): """ # Fix the startup process: util.set_cpu_topology_limit(12) - diff --git a/gamefixes-steam/1097150.py b/gamefixes-steam/1097150.py index b6be231d..72cedfad 100755 --- a/gamefixes-steam/1097150.py +++ b/gamefixes-steam/1097150.py @@ -1,9 +1,6 @@ """ Game fix for Fall Guys """ #pylint: disable=C0103 -import os -import glob -import subprocess from protonfixes import util def main(): diff --git a/gamefixes-steam/1105510.py b/gamefixes-steam/1105510.py index 29cabd86..8f6624c3 100755 --- a/gamefixes-steam/1105510.py +++ b/gamefixes-steam/1105510.py @@ -1,12 +1,9 @@ """ Game fix for Yakuza 5 """ #pylint: disable=C0103 -import os from protonfixes import util def main(): """ Needs WINE_DISABLE_SFN set from this patch: https://github.com/ValveSoftware/wine/pull/205 """ - util.set_environment('WINE_DISABLE_SFN', '1') - diff --git a/gamefixes-steam/1151640.py b/gamefixes-steam/1151640.py index ecaf472e..70bfeb0c 100755 --- a/gamefixes-steam/1151640.py +++ b/gamefixes-steam/1151640.py @@ -5,11 +5,7 @@ from protonfixes import util def main(): - """ - """ - # C++ runtime is not provided in the manifest util.protontricks('vcrun2019') # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code util.set_environment('SteamGameId','1151640') - diff --git a/gamefixes-steam/1174180.py b/gamefixes-steam/1174180.py index dd8bf9d9..04f98b86 100755 --- a/gamefixes-steam/1174180.py +++ b/gamefixes-steam/1174180.py @@ -1,15 +1,11 @@ """ Game fix for Red Dead Redemption 2 """ #pylint: disable=C0103 - -import os from protonfixes import util def main(): """ Sometimes game will not launch if -fullscreen -vulkan is not specified """ - util.append_argument('-fullscreen -vulkan') # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code util.set_environment('SteamGameId','1174180') - diff --git a/gamefixes-steam/1222370.py b/gamefixes-steam/1222370.py index 9daabe50..4fcf1376 100755 --- a/gamefixes-steam/1222370.py +++ b/gamefixes-steam/1222370.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.replace_command('Necromunda.exe', 'Necromunda/Binaries/Win64/Necromunda-Win64-Shipping.exe') diff --git a/gamefixes-steam/1237970.py b/gamefixes-steam/1237970.py index d910be0e..d781409e 100755 --- a/gamefixes-steam/1237970.py +++ b/gamefixes-steam/1237970.py @@ -2,11 +2,10 @@ """ #pylint: disable=C0103 -from protonfixes import util import os -import sys import subprocess import glob +from protonfixes import util def main(): """ Allow -northstar option to work @@ -16,4 +15,4 @@ def main(): # Restore original titanfall2.exe if NorthstarLauncher.exe was previously symlinked if os.path.isfile(install_dir + '/Titanfall2.exe.bak'): - subprocess.run(['mv', 'Titanfall2.exe.bak', 'Titanfall2.exe']) + subprocess.run(['mv', 'Titanfall2.exe.bak', 'Titanfall2.exe'], check=False) diff --git a/gamefixes-steam/1239520.py b/gamefixes-steam/1239520.py index 6120e5bf..985c3cb4 100755 --- a/gamefixes-steam/1239520.py +++ b/gamefixes-steam/1239520.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ - # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') - diff --git a/gamefixes-steam/1240440.py b/gamefixes-steam/1240440.py index 5cc3d9f5..e29eb779 100755 --- a/gamefixes-steam/1240440.py +++ b/gamefixes-steam/1240440.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('vcrun2019') diff --git a/gamefixes-steam/1277510.py b/gamefixes-steam/1277510.py index 544a182f..f64e61dd 100644 --- a/gamefixes-steam/1277510.py +++ b/gamefixes-steam/1277510.py @@ -5,6 +5,4 @@ from protonfixes import util def main(): - """ - """ util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1284210.py b/gamefixes-steam/1284210.py index 7f26f5ca..862c4302 100755 --- a/gamefixes-steam/1284210.py +++ b/gamefixes-steam/1284210.py @@ -2,8 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util def main(): """ GW2 add NOSTEAM option. diff --git a/gamefixes-steam/1293830.py b/gamefixes-steam/1293830.py index 00f4b6a6..6c4b479e 100755 --- a/gamefixes-steam/1293830.py +++ b/gamefixes-steam/1293830.py @@ -5,8 +5,5 @@ from protonfixes import util def main(): - """ - """ - # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') diff --git a/gamefixes-steam/1449280.py b/gamefixes-steam/1449280.py index 141aa414..695e0b17 100755 --- a/gamefixes-steam/1449280.py +++ b/gamefixes-steam/1449280.py @@ -3,16 +3,14 @@ #pylint: disable=C0103 from pathlib import Path from protonfixes import util - -# This directory is required to make the game settings persistent -# [source: https://www.pcgamingwiki.com/wiki/Ghostbusters:_The_Video_Game_Remastered#Game_settings_do_not_save] -save_dir = f"{util.protonprefix()}/drive_c/users/steamuser/Local Settings/Application Data/GHOSTBUSTERS" - +from protonfixes.logger import log def main(): + # This directory is required to make the game settings persistent + # [source: https://www.pcgamingwiki.com/wiki/Ghostbusters:_The_Video_Game_Remastered#Game_settings_do_not_save] + save_dir = f"{util.protonprefix()}/drive_c/users/steamuser/Local Settings/Application Data/GHOSTBUSTERS" + try: Path(save_dir).mkdir(parents=True, exist_ok=True) except OSError as e: - from protonfixes.logger import log - log(f"Not able to make the settings directory at '{save_dir}': {e}") diff --git a/gamefixes-steam/1557480.py b/gamefixes-steam/1557480.py index e03af81f..a0d13516 100755 --- a/gamefixes-steam/1557480.py +++ b/gamefixes-steam/1557480.py @@ -8,5 +8,3 @@ def main(): """ needs native d3dcompiler_47 """ util.protontricks('d3dcompiler_47') - - diff --git a/gamefixes-steam/16810.py b/gamefixes-steam/16810.py index b0c0bc80..12f286c0 100755 --- a/gamefixes-steam/16810.py +++ b/gamefixes-steam/16810.py @@ -4,8 +4,6 @@ from protonfixes import util def main(): - util.protontricks('oleaut32') util.protontricks('msxml3') util.protontricks('corefonts') - diff --git a/gamefixes-steam/1695793.py b/gamefixes-steam/1695793.py index fdbb1136..5a9ffe90 100755 --- a/gamefixes-steam/1695793.py +++ b/gamefixes-steam/1695793.py @@ -7,5 +7,5 @@ from protonfixes import util def main(): - util.protontricks('dotnet35')) + util.protontricks('dotnet35') util.protontricks('dotnet45') diff --git a/gamefixes-steam/1715130.py b/gamefixes-steam/1715130.py index 51dcd56a..c1e8009d 100755 --- a/gamefixes-steam/1715130.py +++ b/gamefixes-steam/1715130.py @@ -5,9 +5,6 @@ from protonfixes import util def main(): - """ - """ - # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/1930.py b/gamefixes-steam/1930.py index 3643747a..90a43e7a 100755 --- a/gamefixes-steam/1930.py +++ b/gamefixes-steam/1930.py @@ -5,8 +5,4 @@ from protonfixes import util def main(): - util.protontricks('xact') - - - diff --git a/gamefixes-steam/200940.py b/gamefixes-steam/200940.py index 98942137..76b31543 100755 --- a/gamefixes-steam/200940.py +++ b/gamefixes-steam/200940.py @@ -1,13 +1,12 @@ """ Game fix for Sonic CD """ -#pylint: disable=C0103 +#pylint: disable=C0103 from protonfixes import util def main(): """ Installs d3dcompiler_43, d3dx9_43, mdx. Locks fps to 60. """ - util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') util.protontricks('mdx') diff --git a/gamefixes-steam/207350.py b/gamefixes-steam/207350.py index 750a9878..f53655f0 100755 --- a/gamefixes-steam/207350.py +++ b/gamefixes-steam/207350.py @@ -5,9 +5,6 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/211420.py b/gamefixes-steam/211420.py index ac248717..80ba08a8 100755 --- a/gamefixes-steam/211420.py +++ b/gamefixes-steam/211420.py @@ -1,4 +1,4 @@ -""" Game fix Dark Sould Prepare To Die Edition +""" Game fix Dark Souls Prepare To Die Edition """ #pylint: disable=C0103 @@ -17,5 +17,3 @@ def main(): util.winedll_override('dinput8', 'n') util.protontricks('win7') - #Avoiding problems with missing syswow64 - util._mk_syswow64() #pylint: disable=protected-access diff --git a/gamefixes-steam/213330.py b/gamefixes-steam/213330.py index ee9fc945..c75606e5 100755 --- a/gamefixes-steam/213330.py +++ b/gamefixes-steam/213330.py @@ -7,5 +7,4 @@ def main(): """ installs d3dx9_41 """ - - util.protontricks('d3dx9_41') + util.protontricks('d3dx9_41') diff --git a/gamefixes-steam/214950.py b/gamefixes-steam/214950.py index f4460bb1..b5ee6d53 100755 --- a/gamefixes-steam/214950.py +++ b/gamefixes-steam/214950.py @@ -7,10 +7,8 @@ def main(): """ installs d3dx11_42, d3dcompiler_42, directplay Disable esync and fsync """ - util.protontricks('d3dx11_42') util.protontricks('d3dcompiler_42') util.protontricks('directplay') - util.disable_esync() util.disable_fsync() diff --git a/gamefixes-steam/215280.py b/gamefixes-steam/215280.py index eb086766..f63d15c0 100755 --- a/gamefixes-steam/215280.py +++ b/gamefixes-steam/215280.py @@ -3,12 +3,8 @@ #pylint: disable=C0103 from protonfixes import util -import os - -import __main__ as protonmain def main(): util.protontricks('d3dx9_43') util.protontricks('d3dx11_43') util.protontricks('d3dcompiler_43') - diff --git a/gamefixes-steam/21680.py b/gamefixes-steam/21680.py index 0d72e424..f2a7725d 100755 --- a/gamefixes-steam/21680.py +++ b/gamefixes-steam/21680.py @@ -2,14 +2,9 @@ """ #pylint: disable=C0103 -import os -import shutil -import subprocess from protonfixes import util def main(): """ Installs physx """ util.protontricks('physx') - - diff --git a/gamefixes-steam/219030.py b/gamefixes-steam/219030.py index 5724bbcc..8a11c5dc 100755 --- a/gamefixes-steam/219030.py +++ b/gamefixes-steam/219030.py @@ -5,9 +5,6 @@ from protonfixes import util def main(): - """ - """ - util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/22370.py b/gamefixes-steam/22370.py index 16d2509b..f86bf89d 100755 --- a/gamefixes-steam/22370.py +++ b/gamefixes-steam/22370.py @@ -2,10 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util -import subprocess import os -import shutil +from protonfixes import util def main(): """ Run script extender if it exists. diff --git a/gamefixes-steam/23460.py b/gamefixes-steam/23460.py index 4bf6fd9b..cdb85882 100644 --- a/gamefixes-steam/23460.py +++ b/gamefixes-steam/23460.py @@ -4,7 +4,8 @@ """ #pylint: disable=C0103 -import os, subprocess +import os +import subprocess from protonfixes import util def main(): diff --git a/gamefixes-steam/237890.py b/gamefixes-steam/237890.py index 45cb95b1..4b2f701f 100755 --- a/gamefixes-steam/237890.py +++ b/gamefixes-steam/237890.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ util.protontricks('wmp9') util.winedll_override('winegstreamer', '') - - diff --git a/gamefixes-steam/2475980.py b/gamefixes-steam/2475980.py index 24b0d81c..d7879cd1 100644 --- a/gamefixes-steam/2475980.py +++ b/gamefixes-steam/2475980.py @@ -3,17 +3,19 @@ """ #pylint: disable=C0103 -from protonfixes import util import os import sys import subprocess import glob +from protonfixes import util def main(): - if (sys.argv[2].find("winsetup")!=-1): os.chdir(sys.argv[2][-29:-13]) + if sys.argv[2].find("winsetup")!=-1: + os.chdir(sys.argv[2][-29:-13]) + install_dir = glob.escape(util.get_game_install_path()) - with open(os.path.join(install_dir,'Gobliiins5-Part4/acsetup.cfg'), 'r') as f: + with open(os.path.join(install_dir,'Gobliiins5-Part4/acsetup.cfg'), 'r', encoding='utf-8') as f: if 'Linear' not in f.read(): for i in range(1,5): - subprocess.call(["sed -i 's/filter=stdscale/filter=Linear/' {}{}{}{}".format(install_dir,'/Gobliiins5-Part',i,'/acsetup.cfg')], shell=True) - subprocess.call(["sed -i 's/translation.*/translation=English/' {}{}{}{}".format(install_dir,'/Gobliiins5-Part',i,'/acsetup.cfg')], shell=True) + subprocess.call([f"sed -i 's/filter=stdscale/filter=Linear/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg"], shell=True) + subprocess.call([f"sed -i 's/translation.*/translation=English/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg"], shell=True) diff --git a/gamefixes-steam/251150.py b/gamefixes-steam/251150.py index c7536c56..3c275e0c 100644 --- a/gamefixes-steam/251150.py +++ b/gamefixes-steam/251150.py @@ -5,7 +5,6 @@ from protonfixes import util def main(): - """ """ util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') diff --git a/gamefixes-steam/251290.py b/gamefixes-steam/251290.py index 191cd3cc..5532f4f7 100644 --- a/gamefixes-steam/251290.py +++ b/gamefixes-steam/251290.py @@ -5,7 +5,6 @@ from protonfixes import util def main(): - """ """ util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') diff --git a/gamefixes-steam/257420.py b/gamefixes-steam/257420.py index 7d7f08cb..be81de8b 100755 --- a/gamefixes-steam/257420.py +++ b/gamefixes-steam/257420.py @@ -4,13 +4,13 @@ import os import subprocess -from protonfixes import util def main(): """ Graphics API workaround """ if not os.path.isfile('UserCfg.lua.bak'): subprocess.call(['cp', 'UserCfg.lua', 'UserCfg.lua.bak']) - f = open('UserCfg.lua',"a+") - f.write("sfx_strAPI = \"OpenAL\";") - f.close + + # Assume UTF-8 + with open('UserCfg.lua', "a+", encoding="utf-8") as f: + f.write("sfx_strAPI = \"OpenAL\";") diff --git a/gamefixes-steam/260130.py b/gamefixes-steam/260130.py index 13f109bb..04322a5e 100755 --- a/gamefixes-steam/260130.py +++ b/gamefixes-steam/260130.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ util.protontricks('wmp9') util.disable_protonaudioconverter() - - diff --git a/gamefixes-steam/282900.py b/gamefixes-steam/282900.py index 951b32e3..46f0bf6d 100755 --- a/gamefixes-steam/282900.py +++ b/gamefixes-steam/282900.py @@ -7,4 +7,4 @@ def main(): util.set_environment('radeonsi_disable_sam', 'true') - util.set_environment('AMD_DEBUG', 'nowc') \ No newline at end of file + util.set_environment('AMD_DEBUG', 'nowc') diff --git a/gamefixes-steam/286360.py b/gamefixes-steam/286360.py index 3f835bdd..339d10cc 100755 --- a/gamefixes-steam/286360.py +++ b/gamefixes-steam/286360.py @@ -3,8 +3,9 @@ """ #pylint: disable=C0103 -from protonfixes import util, os +import os +from protonfixes import util def main(): util.replace_command('SotV_Launcher.exe', 'hd/SotV1.exe') - os.chdir('hd') + os.chdir('hd') diff --git a/gamefixes-steam/289130.py b/gamefixes-steam/289130.py index fda6439e..7e9c8cbf 100755 --- a/gamefixes-steam/289130.py +++ b/gamefixes-steam/289130.py @@ -9,4 +9,3 @@ def main(): """ # Enable preload options util.append_argument('-useembedded') - diff --git a/gamefixes-steam/292410.py b/gamefixes-steam/292410.py index bc8c922c..a4aab892 100644 --- a/gamefixes-steam/292410.py +++ b/gamefixes-steam/292410.py @@ -6,4 +6,4 @@ def main(): util.protontricks('lavfilters') # fix videos - util.winedll_override('d3d9', 'n,b') # in case user uses the ThirteenAG widescreen fix \ No newline at end of file + util.winedll_override('d3d9', 'n,b') # in case user uses the ThirteenAG widescreen fix diff --git a/gamefixes-steam/294700.py b/gamefixes-steam/294700.py index acb4bb4b..42381336 100755 --- a/gamefixes-steam/294700.py +++ b/gamefixes-steam/294700.py @@ -3,8 +3,8 @@ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util # Putt-Putt: PBS doesn't run unless there is a CD-ROM drive attached. def main(): diff --git a/gamefixes-steam/302370.py b/gamefixes-steam/302370.py index 3a8d675b..837f7f9b 100755 --- a/gamefixes-steam/302370.py +++ b/gamefixes-steam/302370.py @@ -5,6 +5,8 @@ """ #pylint: disable=C0103 +import os +import subprocess from protonfixes import util def main(): @@ -13,6 +15,5 @@ def main(): util.regedit_add('HKEY_CURRENT_USER\\Software\\GNU\\ffdshow','blacklist','REG_SZ','OVERSEER.EXE') util.regedit_add('HKEY_CURRENT_USER\\Software\\GNU\\ffdshow_audio','blacklist','REG_SZ','OVERSEER.EXE') if util.protontricks('dgvoodoo2'): - import os, subprocess - syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64') - subprocess.call(["sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {}{}".format(syswow64,'/dgvoodoo.conf')], shell=True) + syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64', 'dgvoodoo.conf') + subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}"], shell=True) diff --git a/gamefixes-steam/307780.py b/gamefixes-steam/307780.py index be6aa430..4e008176 100755 --- a/gamefixes-steam/307780.py +++ b/gamefixes-steam/307780.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ - # Fix pre-rendered cutscene playback util.protontricks('xact_x64') - diff --git a/gamefixes-steam/312060.py b/gamefixes-steam/312060.py index 9d1e933d..439e3861 100755 --- a/gamefixes-steam/312060.py +++ b/gamefixes-steam/312060.py @@ -2,8 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util def main(): """ FFXIV add NOSTEAM option. diff --git a/gamefixes-steam/312670.py b/gamefixes-steam/312670.py index fdce2d36..fada2f79 100755 --- a/gamefixes-steam/312670.py +++ b/gamefixes-steam/312670.py @@ -7,8 +7,6 @@ def main(): """ This bypasses Strange Brigade's Launcher, which renders all black. """ - # Fixes the startup process. util.replace_command('StrangeBrigade.exe', 'StrangeBrigade_Vulkan.exe') util.append_argument('-skipdrivercheck -noHDR') - diff --git a/gamefixes-steam/312790.py b/gamefixes-steam/312790.py index d57c5201..c205b3f0 100755 --- a/gamefixes-steam/312790.py +++ b/gamefixes-steam/312790.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ util.protontricks('wmp9') util.disable_protonaudioconverter() - - diff --git a/gamefixes-steam/328500.py b/gamefixes-steam/328500.py index e1c0ff87..ee967969 100755 --- a/gamefixes-steam/328500.py +++ b/gamefixes-steam/328500.py @@ -15,11 +15,11 @@ def main(): mms_path = os.path.join(flash_path, 'mms.cfg') os.makedirs(flash_path, exist_ok=True) if os.path.isfile(mms_path): - with open(mms_path) as f: + with open(mms_path, encoding='utf-8') as f: for line in f: if 'OverrideGPUValidation' in line: fix_installed = True if not fix_installed: - with open(mms_path, 'a') as f: + with open(mms_path, 'a', encoding='utf-8') as f: f.write('\n') f.write("OverrideGPUValidation=1") diff --git a/gamefixes-steam/329380.py b/gamefixes-steam/329380.py index 040f7258..e28ddd22 100755 --- a/gamefixes-steam/329380.py +++ b/gamefixes-steam/329380.py @@ -9,6 +9,5 @@ def main(): """ dsound is needed for audio """ - log('Installing dsound') - util.protontricks('dsound') \ No newline at end of file + util.protontricks('dsound') diff --git a/gamefixes-steam/35140.py b/gamefixes-steam/35140.py index fbbce8c7..ac79c8de 100755 --- a/gamefixes-steam/35140.py +++ b/gamefixes-steam/35140.py @@ -8,10 +8,8 @@ def main(): """ Needs windxp, dotnet35, phyzx, d3dx9 """ - #Probably not needed when proton will be merged with newer wine + # Probably not needed when proton will be merged with newer wine + # TODO Controllers fixes util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') util.protontricks('physx') - util._mk_syswow64() #pylint: disable=protected-access - -#TODO Controllers fixes diff --git a/gamefixes-steam/351710.py b/gamefixes-steam/351710.py index 2457bf97..9f74a897 100755 --- a/gamefixes-steam/351710.py +++ b/gamefixes-steam/351710.py @@ -7,4 +7,4 @@ def main(): util.set_environment('radeonsi_disable_sam', 'true') - util.set_environment('AMD_DEBUG', 'nowc') + util.set_environment('AMD_DEBUG', 'nowc') diff --git a/gamefixes-steam/356190.py b/gamefixes-steam/356190.py index b00f552b..96544648 100755 --- a/gamefixes-steam/356190.py +++ b/gamefixes-steam/356190.py @@ -7,4 +7,3 @@ def main(): # Requires vcrun2019 to launch util.protontricks('vcrun2019') - diff --git a/gamefixes-steam/359870.py b/gamefixes-steam/359870.py index 19831cfa..eebc96d5 100755 --- a/gamefixes-steam/359870.py +++ b/gamefixes-steam/359870.py @@ -2,18 +2,15 @@ """ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util def main(): - """ - """ # disable new character intro cutscene to prevent black screen loop configpath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/My Documents/SQUARE ENIX/FINAL FANTASY X&X-2 HD Remaster') if not os.path.exists(configpath): os.makedirs(configpath) configgame = os.path.join(configpath, 'GameSetting.ini') if not os.path.isfile(configgame): - f = open(configgame,"w+") - f.write("Language=en") - f.close + with open(configgame,"w+", encoding='utf-8') as f: + f.write("Language=en") diff --git a/gamefixes-steam/366250.py b/gamefixes-steam/366250.py index 8b0c37a8..3b9e9410 100755 --- a/gamefixes-steam/366250.py +++ b/gamefixes-steam/366250.py @@ -3,7 +3,6 @@ #pylint: disable=C0103 from protonfixes import util -import os def main(): util.protontricks('d3dcompiler_46') diff --git a/gamefixes-steam/377160.py b/gamefixes-steam/377160.py index 82a84020..1e46d7fd 100755 --- a/gamefixes-steam/377160.py +++ b/gamefixes-steam/377160.py @@ -2,9 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util -import subprocess import os +from protonfixes import util def main(): """ Run script extender if it exists. diff --git a/gamefixes-steam/378630.py b/gamefixes-steam/378630.py index 0fd63fad..a4e09d81 100755 --- a/gamefixes-steam/378630.py +++ b/gamefixes-steam/378630.py @@ -3,8 +3,9 @@ """ #pylint: disable=C0103 -from protonfixes import util, os +import os +from protonfixes import util def main(): util.replace_command('SotV_Launcher.exe', 'hd/SotV2.exe') - os.chdir('hd') + os.chdir('hd') diff --git a/gamefixes-steam/386360.py b/gamefixes-steam/386360.py index 841ea0f5..4e69c931 100755 --- a/gamefixes-steam/386360.py +++ b/gamefixes-steam/386360.py @@ -19,6 +19,3 @@ def main(): if not os.path.exists(install_dir + '/Win32/EasyAntiCheat/easyanticheat_x86.so'): subprocess.call(['ln', '-s', install_dir + '/EasyAntiCheat/easyanticheat_x86.so', install_dir + '/Win32/EasyAntiCheat/']) - - - diff --git a/gamefixes-steam/39140.py b/gamefixes-steam/39140.py index 6bcc86bf..c8e80409 100755 --- a/gamefixes-steam/39140.py +++ b/gamefixes-steam/39140.py @@ -11,4 +11,3 @@ def main(): # FFVII needs vcrun2019 and d3dcompiler_47 util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') - diff --git a/gamefixes-steam/39210.py b/gamefixes-steam/39210.py index 9d1e933d..439e3861 100755 --- a/gamefixes-steam/39210.py +++ b/gamefixes-steam/39210.py @@ -2,8 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util def main(): """ FFXIV add NOSTEAM option. diff --git a/gamefixes-steam/39500.py b/gamefixes-steam/39500.py index 7cc6f346..1a54e474 100755 --- a/gamefixes-steam/39500.py +++ b/gamefixes-steam/39500.py @@ -15,4 +15,4 @@ def main(): FpS.Max=0 """ - util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') \ No newline at end of file + util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') diff --git a/gamefixes-steam/409090.py b/gamefixes-steam/409090.py index 7916f69b..84dc2edd 100755 --- a/gamefixes-steam/409090.py +++ b/gamefixes-steam/409090.py @@ -6,11 +6,13 @@ """ #pylint: disable=C0103 -import os, subprocess, shutil +import os +import subprocess +import shutil from protonfixes import util def main(): - syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64') + syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64', 'dgvoodoo.conf') if util.protontricks('dgvoodoo2'): - subprocess.call(["sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {}{}".format(syswow64,'/dgvoodoo.conf')], shell=True) + subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}"], shell=True) shutil.copy(os.path.join(syswow64, 'dgd3d9.dll'),os.path.join(syswow64, 'd3d9.dll')) diff --git a/gamefixes-steam/428660.py b/gamefixes-steam/428660.py index 87831ed1..846ca1e0 100755 --- a/gamefixes-steam/428660.py +++ b/gamefixes-steam/428660.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ - # Replace launcher with game exe in proton arguments util.replace_command('MoonMan.exe', 'MoonMan/Binaries/Win64/MoonMan-Win64-Shipping.exe') - diff --git a/gamefixes-steam/429720.py b/gamefixes-steam/429720.py index 0c68727e..8015aaac 100755 --- a/gamefixes-steam/429720.py +++ b/gamefixes-steam/429720.py @@ -3,21 +3,19 @@ #pylint: disable=C0103 -from protonfixes import util import os import getpass +from protonfixes import util -# IMSCARED relies on a folder on the user's Desktop being accessible -# The problem is that all of the folders in Proton are sandboxed -# So this protonfix works around that def main(): + # IMSCARED relies on a folder on the user's Desktop being accessible + # The problem is that all of the folders in Proton are sandboxed + # So this protonfix works around that desktoppath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/Desktop') if os.path.exists(desktoppath): if os.path.islink(desktoppath): - os.unlink(desktoppath) + os.unlink(desktoppath) else: - os.rmdir(desktoppath) + os.rmdir(desktoppath) dst = '/home/' + getpass.getuser() + '/Desktop/' os.symlink(dst, desktoppath) - - diff --git a/gamefixes-steam/436670.py b/gamefixes-steam/436670.py index ea1d0a3b..e64a90fc 100644 --- a/gamefixes-steam/436670.py +++ b/gamefixes-steam/436670.py @@ -5,7 +5,6 @@ from protonfixes import util def main(): - """ """ util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') diff --git a/gamefixes-steam/440900.py b/gamefixes-steam/440900.py index 01725c48..4b097001 100755 --- a/gamefixes-steam/440900.py +++ b/gamefixes-steam/440900.py @@ -12,4 +12,3 @@ def main(): util.install_battleye_runtime() util.replace_command('FuncomLauncher.exe', '../ConanSandbox/Binaries/Win64/ConanSandbox.exe') util.append_argument('-BattlEye') - diff --git a/gamefixes-steam/447040.py b/gamefixes-steam/447040.py index 8d3bf564..4cde1c7e 100755 --- a/gamefixes-steam/447040.py +++ b/gamefixes-steam/447040.py @@ -14,9 +14,8 @@ def main(): os.makedirs(uplayconfigpath) uplayconfigfile = os.path.join(uplayconfigpath, 'settings.yml') if not os.path.isfile(uplayconfigfile): - f = open(uplayconfigfile,"w+") - f.write("overlay:\n enabled: false\n fps_enabled: false\n warning_enabled: false\nuser:\n closebehavior: CloseBehavior_Close\n landingpage: LandingPageLastPlayedGame\n") - f.close + with open(uplayconfigfile,"w+", encoding='utf-8') as f: + f.write("overlay:\n enabled: false\n fps_enabled: false\n warning_enabled: false\nuser:\n closebehavior: CloseBehavior_Close\n landingpage: LandingPageLastPlayedGame\n") # Replace launcher with game exe in proton arguments util.append_argument('-eac_launcher -nosplash') diff --git a/gamefixes-steam/45750.py b/gamefixes-steam/45750.py index 8f8323c5..3c4b864d 100755 --- a/gamefixes-steam/45750.py +++ b/gamefixes-steam/45750.py @@ -3,15 +3,10 @@ 1. A mocked xlive.dll for GFWL (multiplayer will not work, but the single player does) 2. No more than 12 CPU cores (on PCGamingWiki is described as 6, but on my personal test I was able to set until 12 of 16) [source: https://www.pcgamingwiki.com/wiki/Lost_Planet_2#Alternate_solution_for_high_core_CPUs] """ - #pylint: disable=C0103 -import os -import multiprocessing - from protonfixes import util - def main(): util.protontricks('xliveless') diff --git a/gamefixes-steam/46500.py b/gamefixes-steam/46500.py index 91f1773d..7562c3e1 100755 --- a/gamefixes-steam/46500.py +++ b/gamefixes-steam/46500.py @@ -4,14 +4,11 @@ import os import subprocess -from protonfixes import util def main(): """ needs player.ini to prevent black screen on load """ if not os.path.isfile('player.ini'): subprocess.call(['touch', 'player.ini']) - f = open('player.ini',"w+") - f.write("800 600 32 0 BaseCMO.cmo") - f.close - + with open('player.ini',"w+", encoding='utf-8') as f: + f.write("800 600 32 0 BaseCMO.cmo") diff --git a/gamefixes-steam/489830.py b/gamefixes-steam/489830.py index b05eb70c..5e2cd72f 100755 --- a/gamefixes-steam/489830.py +++ b/gamefixes-steam/489830.py @@ -2,14 +2,12 @@ """ #pylint: disable=C0103 -from protonfixes import util -import subprocess import os +from protonfixes import util def main(): """ Run script extender if it exists. """ - if os.path.isfile(os.path.join(os.getcwd(), 'skse64_loader.exe')): if 'MODS' in os.environ: util.replace_command('SkyrimSELauncher.exe', 'skse64_loader.exe') diff --git a/gamefixes-steam/495420.py b/gamefixes-steam/495420.py index d56a20f3..4412b50d 100755 --- a/gamefixes-steam/495420.py +++ b/gamefixes-steam/495420.py @@ -7,7 +7,5 @@ def main(): """ Fix game crashes with d3dcompiler_47 and multiplayer crashes with win7 """ - util.protontricks('d3dcompiler_47') util.protontricks('win7') - diff --git a/gamefixes-steam/497360.py b/gamefixes-steam/497360.py index 6dfcbd04..2746fcaf 100644 --- a/gamefixes-steam/497360.py +++ b/gamefixes-steam/497360.py @@ -8,7 +8,8 @@ #pylint: disable=C0103 -import os, subprocess +import os +import subprocess from protonfixes import util def main(): @@ -26,8 +27,8 @@ def main(): if util.protontricks('dgvoodoo2'): screen_width,screen_height = util.get_resolution() width = int(screen_width / screen_height * 768 // 1) - subprocess.call(["sed -i '/[DirectX]/ {{/Resolution/s/max/{}x768/}}' {}{}".format(width,syswow64,'/dgvoodoo.conf')], shell=True) - subprocess.call(["sed -i '/[DirectXExt]/ {{/ExtraEnumeratedResolutions/s/= /= {}x768,/}}' {}{}".format(width,syswow64,'/dgvoodoo.conf')], shell=True) + subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/{width}x768/}}' {syswow64}/dgvoodoo.conf"], shell=True) + subprocess.call([f"sed -i '/[DirectXExt]/ {{/ExtraEnumeratedResolutions/s/= /= {width}x768,/}}' {syswow64}/dgvoodoo.conf"], shell=True) util.regedit_add('HKCU\\Software\\Sierra On-Line') util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3') util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\App','Run Count','REG_DWORD','0x1') diff --git a/gamefixes-steam/508980.py b/gamefixes-steam/508980.py index c1f31462..ad7a5846 100755 --- a/gamefixes-steam/508980.py +++ b/gamefixes-steam/508980.py @@ -15,9 +15,9 @@ def main(): "Application Data/Crashday/config/graphics.config") # https://stackoverflow.com/a/45435707 - with open(config, 'r') as file: + with open(config, 'r', encoding='utf-8') as file: json_data = json.load(file) if 'FSAA' in json_data: json_data['FSAA'] = 0 - with open(config, 'w') as file: + with open(config, 'w', encoding='utf-8') as file: json.dump(json_data, file, indent=4) diff --git a/gamefixes-steam/55150.py b/gamefixes-steam/55150.py index 2982b256..0946c772 100755 --- a/gamefixes-steam/55150.py +++ b/gamefixes-steam/55150.py @@ -8,6 +8,4 @@ def main(): """ Space Marine chokes on more than 24 cores """ - util.set_cpu_topology_limit(24) - diff --git a/gamefixes-steam/570940.py b/gamefixes-steam/570940.py index 89b05329..4e3d90a5 100755 --- a/gamefixes-steam/570940.py +++ b/gamefixes-steam/570940.py @@ -1,4 +1,4 @@ -""" Game fix Dark Souls Remastered +""" Game fix Dark Souls Remastered """ #pylint: disable=C0103 @@ -7,4 +7,3 @@ def main(): # Requires vcrun2017 to launch util.protontricks('vcrun2017') - diff --git a/gamefixes-steam/582660.py b/gamefixes-steam/582660.py index dc351ba3..a526de02 100755 --- a/gamefixes-steam/582660.py +++ b/gamefixes-steam/582660.py @@ -2,8 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util import os +from protonfixes import util def main(): """ Black Desert Online add NOSTEAM option. diff --git a/gamefixes-steam/601510.py b/gamefixes-steam/601510.py index f2ecd47e..ca2e4d67 100755 --- a/gamefixes-steam/601510.py +++ b/gamefixes-steam/601510.py @@ -5,8 +5,5 @@ from protonfixes import util def main(): - """ - """ - # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') diff --git a/gamefixes-steam/627270.py b/gamefixes-steam/627270.py index 1a23e7d1..0d4d7108 100755 --- a/gamefixes-steam/627270.py +++ b/gamefixes-steam/627270.py @@ -7,4 +7,3 @@ def main(): # Requires vcrun2019 to launch util.protontricks('vcrun2019') - diff --git a/gamefixes-steam/63110.py b/gamefixes-steam/63110.py index c19624d4..ef0e5f21 100755 --- a/gamefixes-steam/63110.py +++ b/gamefixes-steam/63110.py @@ -3,9 +3,9 @@ """ #pylint: disable=C0103 -from protonfixes import util, os +from protonfixes import util def main(): util.replace_command('AlterEgo.exe', './RunDev.exe') util.append_argument('AlterEgo.ebr') - util.set_environment('SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS', '0') + util.set_environment('SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS', '0') diff --git a/gamefixes-steam/633230.py b/gamefixes-steam/633230.py index 650e4369..cc157abf 100755 --- a/gamefixes-steam/633230.py +++ b/gamefixes-steam/633230.py @@ -7,6 +7,4 @@ def main(): util.replace_command('NARUTO.exe', 'NARUTO/Binaries/Win64/NARUTO-Win64-Shipping.exe') util.append_argument('-eac-nop-loaded') - util.protontricks('hidewineexports=enable') - diff --git a/gamefixes-steam/638160.py b/gamefixes-steam/638160.py index 961ce2b5..15084641 100755 --- a/gamefixes-steam/638160.py +++ b/gamefixes-steam/638160.py @@ -4,7 +4,7 @@ from protonfixes import util -def main(): +def main(): util.protontricks('quartz_feb2010') util.protontricks('wmp11') util.protontricks('qasf') diff --git a/gamefixes-steam/65540.py b/gamefixes-steam/65540.py index 2ac10d01..938013ea 100755 --- a/gamefixes-steam/65540.py +++ b/gamefixes-steam/65540.py @@ -2,7 +2,6 @@ """ #pylint: disable=C0103 -import os from protonfixes import util diff --git a/gamefixes-steam/65600.py b/gamefixes-steam/65600.py index 202aa8f9..73bd00f6 100755 --- a/gamefixes-steam/65600.py +++ b/gamefixes-steam/65600.py @@ -15,4 +15,4 @@ def main(): FpS.Max=0 """ - util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') \ No newline at end of file + util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') diff --git a/gamefixes-steam/72850.py b/gamefixes-steam/72850.py index fa04a31d..339db182 100755 --- a/gamefixes-steam/72850.py +++ b/gamefixes-steam/72850.py @@ -2,9 +2,8 @@ """ #pylint: disable=C0103 -from protonfixes import util -import subprocess import os +from protonfixes import util def main(): """ Run script extender if it exists. @@ -14,4 +13,3 @@ def main(): if os.path.isfile(os.path.join(os.getcwd(), 'skse_loader.exe')): if 'MODS' in os.environ: util.replace_command('SkyrimLauncher.exe', 'skse_loader.exe') - diff --git a/gamefixes-steam/729040.py b/gamefixes-steam/729040.py index bf026d77..956cfeab 100755 --- a/gamefixes-steam/729040.py +++ b/gamefixes-steam/729040.py @@ -5,7 +5,4 @@ from protonfixes import util def main(): - """ - """ - - util.replace_command('Launcher.exe', 'BorderlandsGOTY.exe') \ No newline at end of file + util.replace_command('Launcher.exe', 'BorderlandsGOTY.exe') diff --git a/gamefixes-steam/740550.py b/gamefixes-steam/740550.py index 3ce03f3f..6bda960b 100755 --- a/gamefixes-steam/740550.py +++ b/gamefixes-steam/740550.py @@ -5,9 +5,5 @@ from protonfixes import util def main(): - """ - """ util.protontricks('wmp9') util.disable_protonaudioconverter() - - diff --git a/gamefixes-steam/750920.py b/gamefixes-steam/750920.py index fc551927..8547775a 100755 --- a/gamefixes-steam/750920.py +++ b/gamefixes-steam/750920.py @@ -9,4 +9,3 @@ def main(): """ util.protontricks('d3dcompiler_47') - diff --git a/gamefixes-steam/773370.py b/gamefixes-steam/773370.py index 4bf00a70..687d0ccc 100755 --- a/gamefixes-steam/773370.py +++ b/gamefixes-steam/773370.py @@ -9,4 +9,3 @@ def main(): """ util.protontricks('d3dcompiler_47') - diff --git a/gamefixes-steam/78000.py b/gamefixes-steam/78000.py index 4eff0440..4a12a307 100755 --- a/gamefixes-steam/78000.py +++ b/gamefixes-steam/78000.py @@ -1,6 +1,6 @@ """ Game fix for Bejeweled 3 """ -#pylint: disable=C0103 +#pylint: disable=C0103 from protonfixes import util diff --git a/gamefixes-steam/812140.py b/gamefixes-steam/812140.py index e5f2fd24..72c86484 100755 --- a/gamefixes-steam/812140.py +++ b/gamefixes-steam/812140.py @@ -12,8 +12,7 @@ def main(): os.makedirs(uplayconfigpath) uplayconfigfile = os.path.join(uplayconfigpath, 'settings.yml') if not os.path.isfile(uplayconfigfile): - f = open(uplayconfigfile,"w+") - f.write("overlay:\n enabled: false\n fps_enabled: false\n warning_enabled: false\nuser:\n closebehavior: CloseBehavior_Close\n landingpage: LandingPageLastPlayedGame\n") - f.close + with open(uplayconfigfile,"w+", encoding='utf-8') as f: + f.write("overlay:\n enabled: false\n fps_enabled: false\n warning_enabled: false\nuser:\n closebehavior: CloseBehavior_Close\n landingpage: LandingPageLastPlayedGame\n") # Replace launcher with game exe in proton arguments util.append_argument('-eac_launcher -nosplash') diff --git a/gamefixes-steam/813780.py b/gamefixes-steam/813780.py index 05edd58b..27c4752f 100755 --- a/gamefixes-steam/813780.py +++ b/gamefixes-steam/813780.py @@ -7,4 +7,3 @@ def main(): # Requires vcrun2019 to launch util.protontricks('vcrun2019') - diff --git a/gamefixes-steam/8190.py b/gamefixes-steam/8190.py index f139e0fb..93aded98 100755 --- a/gamefixes-steam/8190.py +++ b/gamefixes-steam/8190.py @@ -12,4 +12,3 @@ def main(): util.protontricks('d3dcompiler_47') util.protontricks('d3dx10') util.append_argument('-borderless') - diff --git a/gamefixes-steam/893180.py b/gamefixes-steam/893180.py index 0dcaa15e..755ecc81 100755 --- a/gamefixes-steam/893180.py +++ b/gamefixes-steam/893180.py @@ -5,8 +5,6 @@ from protonfixes import util def main(): - """ - """ util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/976310.py b/gamefixes-steam/976310.py index c116f256..fb3d310b 100755 --- a/gamefixes-steam/976310.py +++ b/gamefixes-steam/976310.py @@ -7,4 +7,3 @@ def main(): # Requires vcrun2019 to launch util.protontricks('vcrun2019') - diff --git a/gamefixes-steam/default.py b/gamefixes-steam/default.py index 200c866d..11aeb5d3 100755 --- a/gamefixes-steam/default.py +++ b/gamefixes-steam/default.py @@ -13,11 +13,7 @@ def use_steam_commands(): for pf_alias in pf_alias_list: sys.argv.remove(pf_alias) - if pf_alias == '-pf_winecfg': - util.winecfg() - elif pf_alias == '-pf_regedit': - util.regedit() - elif pf_alias.split('=')[0] == '-pf_tricks': + if pf_alias.split('=')[0] == '-pf_tricks': param = str(pf_alias.replace('-pf_tricks=', '')) util.protontricks(param) elif pf_alias.split('=')[0] == '-pf_dxvk_set': @@ -25,4 +21,4 @@ def use_steam_commands(): dxvk_opt = param.split('=') util.set_dxvk_option(str(dxvk_opt[0]), str(dxvk_opt[1])) - use_steam_commands() + use_steam_commands() diff --git a/gamefixes-ulwgl/default.py b/gamefixes-ulwgl/default.py index 031438a9..8a32b2b2 100755 --- a/gamefixes-ulwgl/default.py +++ b/gamefixes-ulwgl/default.py @@ -1,6 +1,3 @@ -import sys -from protonfixes import util - def main(): """ global defaults """ diff --git a/gamefixes-ulwgl/ulwgl-2016590.py b/gamefixes-ulwgl/ulwgl-2016590.py index c45063d7..8c01f30f 100644 --- a/gamefixes-ulwgl/ulwgl-2016590.py +++ b/gamefixes-ulwgl/ulwgl-2016590.py @@ -2,7 +2,6 @@ """ #pylint: disable=C0103 -import os from protonfixes import util def main(): diff --git a/gamefixes-zoomplatform/ulwgl-240200.py b/gamefixes-zoomplatform/ulwgl-240200.py index 2a4edc14..d62c97e8 100644 --- a/gamefixes-zoomplatform/ulwgl-240200.py +++ b/gamefixes-zoomplatform/ulwgl-240200.py @@ -3,8 +3,7 @@ #pylint: disable=C0103 from protonfixes import util -import os def main(): util.winedll_override('d3d8', 'n,b') - util.protontricks('vcrun2019') \ No newline at end of file + util.protontricks('vcrun2019') diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f35a59a5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,540 @@ +[tool.pylint.main] +# Analyse import fallback blocks. This can be used to support both Python 2 and 3 +# compatible code, which means that the block might have code that exists only in +# one or another interpreter, leading to false positives when analysed. +# analyse-fallback-blocks = + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint in +# a server-like mode. +# clear-cache-post-run = + +# Always return a 0 (non-error) status code, even if lint errors are found. This +# is primarily useful in continuous integration scripts. +# exit-zero = + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +# extension-pkg-allow-list = + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +# extension-pkg-whitelist = + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +# fail-on = + +# Specify a score threshold under which the program will exit with error. +fail-under = 10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +# from-stdin = + +# Files or directories to be skipped. They should be base names, not paths. +ignore = ["CVS"] + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, it +# can't be used as an escape character. +# ignore-paths = + +# Files or directories matching the regular expression patterns are skipped. The +# regex matches against base names, not paths. The default value ignores Emacs +# file locks +# ignore-patterns = + +# List of module names for which member attributes should not be checked (useful +# for modules/projects where namespaces are manipulated during runtime and thus +# existing member attributes cannot be deduced by static analysis). It supports +# qualified module names, as well as Unix pattern matching. +# ignored-modules = + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +# init-hook = + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs = 0 + +# Control the amount of potential inferred values when inferring a single object. +# This can help the performance when dealing with large functions or complex, +# nested conditions. +limit-inference-results = 100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +# load-plugins = + +# Pickle collected data for later comparisons. +persistent = true + +# Minimum Python version to use for version dependent checks. Will default to the +# version used to run pylint. +py-version = "3.9" + +# Discover python modules and packages in the file system subtree. +# recursive = + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +# source-roots = + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode = true + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +# unsafe-load-any-extension = + +[tool.pylint.basic] +# Naming style matching correct argument names. +argument-naming-style = "snake_case" + +# Regular expression matching correct argument names. Overrides argument-naming- +# style. If left empty, argument names will be checked with the set naming style. +argument-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" + +# Naming style matching correct attribute names. +attr-naming-style = "snake_case" + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +attr-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" + +# Bad variable names which should always be refused, separated by a comma. +bad-names = ["foo", "bar", "baz", "toto", "tutu", "tata"] + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +# bad-names-rgxs = + +# Naming style matching correct class attribute names. +class-attribute-naming-style = "any" + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$" + +# Naming style matching correct class constant names. +class-const-naming-style = "UPPER_CASE" + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +# class-const-rgx = + +# Naming style matching correct class names. +class-naming-style = "PascalCase" + +# Regular expression matching correct class names. Overrides class-naming-style. +# If left empty, class names will be checked with the set naming style. +class-rgx = "[A-Z_][a-zA-Z0-9]+$" + +# Naming style matching correct constant names. +const-naming-style = "UPPER_CASE" + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming style. +const-rgx = "(([A-Z_][A-Z0-9_]*)|(__.*__))$" + +# Minimum line length for functions/classes that require docstrings, shorter ones +# are exempt. +docstring-min-length = -1 + +# Naming style matching correct function names. +function-naming-style = "snake_case" + +# Regular expression matching correct function names. Overrides function-naming- +# style. If left empty, function names will be checked with the set naming style. +function-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" + +# Good variable names which should always be accepted, separated by a comma. +good-names = ["i", "j", "k", "ex", "Run", "_"] + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +# good-names-rgxs = + +# Include a hint for the correct naming format with invalid-name. +# include-naming-hint = + +# Naming style matching correct inline iteration names. +inlinevar-naming-style = "any" + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +inlinevar-rgx = "[A-Za-z_][A-Za-z0-9_]*$" + +# Naming style matching correct method names. +method-naming-style = "snake_case" + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +method-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" + +# Naming style matching correct module names. +module-naming-style = "snake_case" + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +module-rgx = "(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$" + +# Colon-delimited sets of names that determine each other's naming style when the +# name regexes allow several styles. +# name-group = + +# Regular expression which should only match function or class names that do not +# require a docstring. +no-docstring-rgx = "^_" + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. These +# decorators are taken in consideration only for invalid-name. +property-classes = ["abc.abstractproperty"] + +# Regular expression matching correct type alias names. If left empty, type alias +# names will be checked with the set naming style. +# typealias-rgx = + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +# typevar-rgx = + +# Naming style matching correct variable names. +variable-naming-style = "snake_case" + +# Regular expression matching correct variable names. Overrides variable-naming- +# style. If left empty, variable names will be checked with the set naming style. +variable-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" + +[tool.pylint.classes] +# Warn about protected attribute access inside special methods +# check-protected-access-in-special-methods = + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods = ["__init__", "__new__", "setUp"] + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"] + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg = ["cls"] + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg = ["mcs"] + +[tool.pylint.design] +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +# exclude-too-few-public-methods = + +# List of qualified class names to ignore when counting class parents (see R0901) +# ignored-parents = + +# Maximum number of arguments for function / method. +max-args = 5 + +# Maximum number of attributes for a class (see R0902). +max-attributes = 7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr = 5 + +# Maximum number of branch for function / method body. +max-branches = 12 + +# Maximum number of locals for function / method body. +max-locals = 15 + +# Maximum number of parents for a class (see R0901). +max-parents = 7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods = 20 + +# Maximum number of return / yield for function / method body. +max-returns = 6 + +# Maximum number of statements in function / method body. +max-statements = 50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods = 2 + +[tool.pylint.exceptions] +# Exceptions that will emit a warning when caught. +# overgeneral-exceptions = ["Exception"] + +[tool.pylint.format] +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +# expected-line-ending-format = + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines = "^\\s*(# )??$" + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren = 4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string = " " + +# Maximum number of characters on a single line. +max-line-length = 100 + +# Maximum number of lines in a module. +max-module-lines = 1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +# single-line-class-stmt = + +# Allow the body of an if to be on the same line as the test if there is no else. +# single-line-if-stmt = + +[tool.pylint.imports] +# List of modules that can be imported at any level, not just the top level one. +# allow-any-import-level = + +# Allow explicit reexports by alias from a package __init__. +# allow-reexport-from-package = + +# Allow wildcard imports from modules that define __all__. +# allow-wildcard-with-all = + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules = ["optparse", "tkinter.tix"] + +# Output a graph (.gv or any supported image format) of external dependencies to +# the given file (report RP0402 must not be disabled). +# ext-import-graph = + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be disabled). +# import-graph = + +# Output a graph (.gv or any supported image format) of internal dependencies to +# the given file (report RP0402 must not be disabled). +# int-import-graph = + +# Force import order to recognize a module as part of the standard compatibility +# libraries. +# known-standard-library = + +# Force import order to recognize a module as part of a third party library. +known-third-party = ["enchant"] + +# Couples of modules and preferred modules, separated by a comma. +# preferred-modules = + +[tool.pylint.logging] +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style = "old" + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules = ["logging"] + +[tool.pylint."messages control"] +# Only show warnings with the listed confidence levels. Leave empty to show all. +# Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED. +confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"] + +# Disable the message, report, category or checker with the given id(s). You can +# either give multiple identifiers separated by comma (,) or put this option +# multiple times (only on the command line, not in the configuration file where +# it should appear only once). You can also use "--disable=all" to disable +# everything first and then re-enable specific checks. For example, if you want +# to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "duplicate-code", "fixme", "too-many-branches", "c-extension-no-member", "literal-comparison", "pointless-string-statement"] + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where it +# should appear only once). See also the "--disable" option for examples. +# enable = + +[tool.pylint.method_args] +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods = ["requests.api.delete", "requests.api.get", "requests.api.head", "requests.api.options", "requests.api.patch", "requests.api.post", "requests.api.put", "requests.api.request"] + +[tool.pylint.miscellaneous] +# List of note tags to take in consideration, separated by a comma. +notes = ["FIXME", "XXX", "TODO"] + +# Regular expression of note tags to take in consideration. +# notes-rgx = + +[tool.pylint.refactoring] +# Maximum number of nested blocks for function / method body +max-nested-blocks = 5 + +# Complete name of functions that never returns. When checking for inconsistent- +# return-statements if a never returning function is called then it will be +# considered as an explicit return statement and no message will be printed. +never-returning-functions = ["sys.exit", "argparse.parse_error"] + +# Let 'consider-using-join' be raised when the separator to join on would be non- +# empty (resulting in expected fixes of the type: ``"- " + " - ".join(items)``) +suggest-join-with-non-empty-separator = true + +[tool.pylint.reports] +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each category, +# as well as 'statement' which is the total number of statements analyzed. This +# score is used by the global evaluation report (RP0004). +evaluation = "10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)" + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +# msg-template = + +# Set the output format. Available formats are: text, parseable, colorized, json2 +# (improved json format), json (old json format) and msvs (visual studio). You +# can also give a reporter class, e.g. mypackage.mymodule.MyReporterClass. +# output-format = + +# Tells whether to display a full report or only the messages. +# reports = + +# Activate the evaluation score. +score = true + +[tool.pylint.similarities] +# Comments are removed from the similarity computation +ignore-comments = true + +# Docstrings are removed from the similarity computation +ignore-docstrings = true + +# Imports are removed from the similarity computation +ignore-imports = true + +# Signatures are removed from the similarity computation +ignore-signatures = true + +# Minimum lines number of a similarity. +min-similarity-lines = 4 + +[tool.pylint.spelling] +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions = 4 + +# Spelling dictionary name. No available dictionaries : You need to install both +# the python package and the system dependency for enchant to work. +# spelling-dict = + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives = "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:" + +# List of comma separated words that should not be checked. +# spelling-ignore-words = + +# A path to a file that contains the private dictionary; one word per line. +# spelling-private-dict-file = + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +# spelling-store-unknown-words = + +[tool.pylint.typecheck] +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators = ["contextlib.contextmanager"] + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members = "env,dlloverrides,wine_path,bindir,config.*" + +# Tells whether missing members accessed in mixin class should be ignored. A +# class is considered mixin if its name matches the mixin-class-rgx option. +# Tells whether to warn about missing members when the owner of the attribute is +# inferred to be None. +ignore-none = true + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference can +# return multiple potential results while evaluating a Python object, but some +# branches might not be evaluated, which results in partial inference. In that +# case, it might be useful to still emit no-member and other checks for the rest +# of the inferred objects. +ignore-on-opaque-inference = true + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins = ["no-member", "not-async-context-manager", "not-context-manager", "attribute-defined-outside-init"] + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes = ["optparse.Values", "thread._local", "_thread._local"] + +# Show a hint with possible names when a member name was not found. The aspect of +# finding the hint is based on edit distance. +missing-member-hint = true + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance = 1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices = 1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx = ".*[Mm]ixin" + +# List of decorators that change the signature of a decorated function. +# signature-mutators = + +[tool.pylint.variables] +# List of additional names supposed to be defined in builtins. Remember that you +# should avoid defining new builtins when possible. +# additional-builtins = + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables = true + +# List of names allowed to shadow builtins +# allowed-redefined-builtins = + +# List of strings which can identify a callback function by name. A callback name +# must start or end with one of those strings. +callbacks = ["cb_", "_cb"] + +# A regular expression matching the name of dummy variables (i.e. expected to not +# be used). +dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_" + +# Argument names that match this expression will be ignored. +ignored-argument-names = "_.*|^ignored_|^unused_" + +# Tells whether we should check for unused import in __init__ files. +# init-import = + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules = ["six.moves", "future.builtins"] diff --git a/tools/check-links.sh b/tools/check-links.sh new file mode 100644 index 00000000..455d9cb6 --- /dev/null +++ b/tools/check-links.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# +# Check for valid symbolic links for non-Steam gamefixes +# + +# Lint the following gamefix dir: +# gog, amazon, egs, humble, itchio, ubisoft, ulwgl, zoomplatform +for file in ./{gamefixes-amazon,gamefixes-gog,gamefixes-egs,gamefixes-humble,gamefixes-itchio,gamefixes-ubisoft,gamefixes-ulwgl,gamefixes-zoomplatform}/*; do + if [[ -L "$file" && ! -e "$file" ]]; then + echo "The following file is not a valid link: ${file}" + exit 1 + fi +done diff --git a/tools/lint.sh b/tools/lint.sh new file mode 100644 index 00000000..31b332fd --- /dev/null +++ b/tools/lint.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# +# Lint with Pylint +# + +# Lint the following gamefix dir: +# steam, gog, amazon, egs, humble, itchio, ubisoft, ulwgl, zoomplatform +mapfile -d '' files_array < <(find ./{gamefixes-steam,gamefixes-amazon,gamefixes-gog,gamefixes-egs,gamefixes-humble,gamefixes-itchio,gamefixes-ubisoft,gamefixes-ulwgl,gamefixes-zoomplatform} -type f -name "*.py" ! -name "__init__.py" -print0) + +# Disable these checks: +# - Long lines from comments +# - Import errors because ULWGL-protonfixes will be renamed at release +# - Docstrings for functions and modules +# - Invalid identifier names for files +pylint --rcfile pyproject.toml --disable C0103,C0116,E0401,C0301,C0114 "${files_array[@]}"