Skip to content

Commit e64fb67

Browse files
committed
MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
1 parent f5e33ae commit e64fb67

File tree

536 files changed

+6307
-5596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

536 files changed

+6307
-5596
lines changed

.pre-commit-config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ repos:
44
rev: v4.1.0
55
hooks:
66
- id: check-ast
7-
- id: check-byte-order-marker
87
- id: check-case-conflict
98
- id: check-docstring-first
109
- id: check-executables-have-shebangs

00_Utilities/DotnetUtils/.editorconfig

+10-10
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ dotnet_naming_rule.private_members_should_be_pascal_case.style = camel_case
6565

6666
dotnet_naming_symbols.interface.applicable_kinds = interface
6767
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
68-
dotnet_naming_symbols.interface.required_modifiers =
68+
dotnet_naming_symbols.interface.required_modifiers =
6969

7070
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum, delegate
7171
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
72-
dotnet_naming_symbols.types.required_modifiers =
72+
dotnet_naming_symbols.types.required_modifiers =
7373

7474
dotnet_naming_symbols.non_private_members.applicable_kinds = property, method, field, event
7575
dotnet_naming_symbols.non_private_members.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
@@ -80,19 +80,19 @@ dotnet_naming_symbols.private_members.applicable_accessibilities = private
8080

8181
# Naming styles
8282

83-
dotnet_naming_style.pascal_case.required_prefix =
84-
dotnet_naming_style.pascal_case.required_suffix =
85-
dotnet_naming_style.pascal_case.word_separator =
83+
dotnet_naming_style.pascal_case.required_prefix =
84+
dotnet_naming_style.pascal_case.required_suffix =
85+
dotnet_naming_style.pascal_case.word_separator =
8686
dotnet_naming_style.pascal_case.capitalization = pascal_case
8787

8888
dotnet_naming_style.begins_with_i.required_prefix = I
89-
dotnet_naming_style.begins_with_i.required_suffix =
90-
dotnet_naming_style.begins_with_i.word_separator =
89+
dotnet_naming_style.begins_with_i.required_suffix =
90+
dotnet_naming_style.begins_with_i.word_separator =
9191
dotnet_naming_style.begins_with_i.capitalization = pascal_case
9292

93-
dotnet_naming_style.camel_case.required_prefix =
94-
dotnet_naming_style.camel_case.required_suffix =
95-
dotnet_naming_style.camel_case.word_separator =
93+
dotnet_naming_style.camel_case.required_prefix =
94+
dotnet_naming_style.camel_case.required_suffix =
95+
dotnet_naming_style.camel_case.word_separator =
9696
dotnet_naming_style.camel_case.capitalization = camel_case
9797

9898

00_Utilities/DotnetUtils/DotnetUtils/PortInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public record PortInfo(
99
string LangPath, string Lang, string Ext, string ProjExt,
1010
string[] CodeFiles, string[] Slns, string[] Projs
1111
) {
12-
12+
1313
private static readonly EnumerationOptions enumerationOptions = new() {
1414
RecurseSubdirectories = true,
1515
MatchType = MatchType.Simple,
@@ -34,7 +34,7 @@ public record PortInfo(
3434
int.TryParse(parts[0], out var n) && n > 0 ? // ignore utilities folder
3535
n :
3636
(int?)null,
37-
specialGameNames.TryGetValue(parts[1], out var specialName) ?
37+
specialGameNames.TryGetValue(parts[1], out var specialName) ?
3838
specialName :
3939
parts[1].Replace("_", "").Replace("-", "")
4040
);

00_Utilities/DotnetUtils/DotnetUtils/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void generateMissingSlns() {
180180
void generateMissingProjs() {
181181
foreach (var item in infos.Where(x => x.Projs.None())) {
182182
// We can't use the dotnet command to create a new project using the built-in console template, because part of that template
183-
// is a Program.cs / Program.vb file. If there already are code files, there's no need to add a new empty one; and
183+
// is a Program.cs / Program.vb file. If there already are code files, there's no need to add a new empty one; and
184184
// if there's already such a file, it might try to overwrite it.
185185

186186
var projText = item.Lang switch {

00_Utilities/bas2perl.pl

+5-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
my $Pedantic= 0;
99
my $Indent= 0;
1010

11-
my %Vars; # num | str | anm | ast
11+
my %Vars; # num | str | anm | ast
1212
my @Data;
1313
my %Code;
1414
open(FH, $File);
@@ -278,7 +278,7 @@ sub PRINT {
278278
push @Out, $Par;
279279
}
280280

281-
my $Out= join(". ", @Out);
281+
my $Out= join(". ", @Out);
282282
if ($Enter) { $Out.= qq|. "\\n"|; }
283283
return "print ".$Out;
284284
}
@@ -347,7 +347,7 @@ sub FORMULA {
347347
if ($Vars{$Key}!~ /^a/) { next; }
348348
$Str=~ s/\$$Key\((.*?)\)/\$$Key\[$1\]/g;
349349
}
350-
350+
351351
if ($Cond==1) {
352352
$Str=~ s/<>/ ne /g;
353353
$Str=~ s/=/ eq /g;
@@ -357,7 +357,7 @@ sub FORMULA {
357357

358358

359359
sub SMARPLIT {
360-
my ($Str, $Sep, $Nin)= @_;
360+
my ($Str, $Sep, $Nin)= @_;
361361
my @Parts;
362362
my $Text= "";
363363
my $Flag= 0;
@@ -373,8 +373,5 @@ sub SMARPLIT {
373373
$Text.= $Char;
374374
}
375375
if ($Text) { push @Parts, &TRIM($Text); }
376-
return @Parts;
376+
return @Parts;
377377
}
378-
379-
380-

00_Utilities/find-unimplemented.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Program to show unimplemented games by language, optionally filtered by
2+
* Program to show unimplemented games by language, optionally filtered by
33
* language
4-
*
4+
*
55
* Usage: node find-unimplemented.js [[[lang1] lang2] ...]
6-
*
6+
*
77
* Adapted from find-missing-implementtion.js
88
*/
99

00_Utilities/jvmTestUtils/kotlin/test/ConsoleTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ abstract class ConsoleTest {
3434

3535
private fun String.trimWhiteSpace() =
3636
replace("[\\s]+".toRegex(), " ")
37-
}
37+
}

00_Utilities/yatol.pl

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
foreach my $Dir (@Langs) {
2121
printf("%$Tab\s", $Dir);
22-
}
22+
}
2323
print "\n";
2424

2525
my $Count;
@@ -39,7 +39,7 @@
3939
if ($Ret>1) { printf("%$Tab\s", "YES"); $Sum{$Dir}++; }
4040
else { printf("%$Tab\s", " ");}
4141
}
42-
print "\n";
42+
print "\n";
4343
}
4444

4545

@@ -57,4 +57,3 @@
5757
printf("%$Tab\s", "$Per");
5858
}
5959
print "\n";
60-

01_Acey_Ducey/csharp/GameState.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace AceyDucey
99
/// </summary>
1010
internal class GameState
1111
{
12-
12+
1313
/// <summary>
1414
/// How much money does the player have at the moment?
1515
/// </summary>

01_Acey_Ducey/d/aceyducey.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void main()
5555
{
5656
writeln("YOU WIN!!!");
5757
cash += bet;
58-
}
58+
}
5959
else
6060
{
6161
writeln("Sorry, you lose.");

01_Acey_Ducey/java/src/AceyDucey.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@ public void intro() {
169169
System.out.println("A VALUE BETWEEN THE FIRST TWO.");
170170
System.out.println("IF YOU DO NOT WANT TO BET, INPUT: 0");
171171
}
172-
}
172+
}

01_Acey_Ducey/java/src/AceyDucey17.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static void main(String[] args) {
1515
System.out.println("""
1616
ACEY DUCEY CARD GAME
1717
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY
18-
19-
18+
19+
2020
ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER
2121
THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP
2222
YOU HAVE AN OPTION TO BET OR NOT BET DEPENDING

01_Acey_Ducey/java/src/AceyDuceyGame.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ public static void main(String[] args) {
1818
keepPlaying = game.playAgain();
1919
} while (keepPlaying);
2020
}
21-
}
21+
}

01_Acey_Ducey/javascript/aceyducey.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async function main() {
9999
}
100100
}
101101
}
102-
if (bet == 0)
102+
if (bet == 0)
103103
{
104104
// User chose not to bet.
105105
print('CHICKEN!!');

01_Acey_Ducey/pascal/object-pascal/aceyducey.pas

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
Acey_Ducey:= TGame.Create;
1717
Acey_Ducey.Run;
1818
end.
19-

01_Acey_Ducey/pascal/object-pascal/deck.pas

-1
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,3 @@ function TDeck.PlayerWins: Boolean;
108108
end;
109109

110110
end.
111-

01_Acey_Ducey/pascal/object-pascal/game.pas

-1
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,3 @@ procedure TGame.Run;
133133
end;
134134

135135
end.
136-

01_Acey_Ducey/pascal/simple/aceyducey.pas

-1
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ function TryAgain: Boolean;
149149
until not TryAgain;
150150
WriteLN('O.K., HOPE YOU HAD FUN!');
151151
end.
152-

01_Acey_Ducey/python/acey_ducey_oo.py

+29-25
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#
1212
######################################################
1313

14+
1415
class Card:
1516
def __init__(self, suit, rank):
1617
self.suit = suit
@@ -19,14 +20,14 @@ def __init__(self, suit, rank):
1920
def __str__(self):
2021
r = self.rank
2122
if r == 11:
22-
r = 'J'
23+
r = "J"
2324
elif r == 12:
24-
r = 'Q'
25+
r = "Q"
2526
elif r == 13:
26-
r = 'K'
27+
r = "K"
2728
elif r == 14:
28-
r = 'A'
29-
return f'{r}{self.suit}'
29+
r = "A"
30+
return f"{r}{self.suit}"
3031

3132

3233
class Deck:
@@ -35,12 +36,13 @@ def __init__(self):
3536
self.build()
3637

3738
def build(self):
38-
for suit in ['\u2665', '\u2666', '\u2663', '\u2660']:
39+
for suit in ["\u2665", "\u2666", "\u2663", "\u2660"]:
3940
for rank in range(2, 15):
4041
self.cards.append(Card(suit, rank))
4142

4243
def shuffle(self):
4344
import random
45+
4446
random.shuffle(self.cards)
4547

4648
def deal(self):
@@ -69,34 +71,34 @@ def play(self):
6971
self.card_b = self.deck.deal()
7072
card_b = self.card_b
7173

72-
print(f'You have:\t ${self.money} ')
73-
print(f'Your cards:\t {card_a} {card_b}')
74+
print(f"You have:\t ${self.money} ")
75+
print(f"Your cards:\t {card_a} {card_b}")
7476

75-
bet = int(input('What is your bet? '))
77+
bet = int(input("What is your bet? "))
7678
player_card = self.deck.deal()
7779
if 0 < bet <= self.money:
7880

79-
print(f'Your deal:\t {player_card}')
81+
print(f"Your deal:\t {player_card}")
8082
if card_a.rank < player_card.rank < card_b.rank:
81-
print('You Win!')
83+
print("You Win!")
8284
self.money += bet
8385
else:
84-
print('You Lose!')
86+
print("You Lose!")
8587
self.money -= bet
8688
self.not_done = False
8789
else:
88-
print('Chicken!')
89-
print(f'Your deal should have been: {player_card}')
90+
print("Chicken!")
91+
print(f"Your deal should have been: {player_card}")
9092
if card_a.rank < player_card.rank < card_b.rank:
91-
print(f'You could have won!')
93+
print(f"You could have won!")
9294
else:
93-
print(f'You would lose, so it was wise of you to chicken out!')
95+
print(f"You would lose, so it was wise of you to chicken out!")
9496

9597
self.not_done = False
9698
break
9799

98100
if len(self.deck.cards) <= 3:
99-
print('You ran out of cards. Game over.')
101+
print("You ran out of cards. Game over.")
100102
self.not_done = False
101103
break
102104

@@ -107,22 +109,24 @@ def play(self):
107109
self.not_done = False
108110

109111

110-
if __name__ == '__main__':
111-
print('''
112+
if __name__ == "__main__":
113+
print(
114+
"""
112115
Acey Ducey is a card game where you play against the computer.
113116
The Dealer(computer) will deal two cards facing up.
114-
You have an option to bet or not bet depending on whether or not you
117+
You have an option to bet or not bet depending on whether or not you
115118
feel the card will have a value between the first two.
116119
If you do not want to bet input a 0
117-
''')
120+
"""
121+
)
118122
GAME_OVER = False
119123

120124
while not GAME_OVER:
121125
game = Game()
122126
game.play()
123-
print(f'You have ${game.money} left')
124-
print('Would you like to play again? (y/n)')
125-
if input() == 'n':
127+
print(f"You have ${game.money} left")
128+
print("Would you like to play again? (y/n)")
129+
if input() == "n":
126130
GAME_OVER = True
127131

128-
print('\nThanks for playing!')
132+
print("\nThanks for playing!")

0 commit comments

Comments
 (0)