Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Nov 7, 2024
1 parent e7aa848 commit 20fe823
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
12 changes: 8 additions & 4 deletions DraftCleaner/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function deleteRequireFunctions($str) {

function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_API_URL, $WIKIPEDIA_USERNAME, $WIKIPEDIA_PASSWORD) {
// clear cookies from last session
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die ('Unable to open file!');
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die('Unable to open file!');
fwrite($file, '');
fclose($file);

Expand Down Expand Up @@ -73,7 +73,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
'type' => 'csrf',
];
$csrfToken = apiSendAndReceive($apiData, $WIKIPEDIA_API_URL, $ABSOLUTE_PATH_TO_TEMP_DIRECTORY)['query']['tokens']['csrftoken'];

// make edit
$apiData = [
'action' => 'edit',
Expand All @@ -95,8 +95,12 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
if ( $fileName === '.' ) continue;
if ( $fileName === '..' ) continue;
if ( $fileName === '.' ) {
continue;
}
if ( $fileName === '..' ) {
continue;
}
$path = $CLASSES_FOLDER_PATH . $fileName;
$classText = file_get_contents($path);
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
Expand Down
12 changes: 8 additions & 4 deletions SpeciesHelper/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function deleteRequireFunctions($str) {

function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_API_URL, $WIKIPEDIA_USERNAME, $WIKIPEDIA_PASSWORD) {
// clear cookies from last session
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die ('Unable to open file!');
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die('Unable to open file!');
fwrite($file, '');
fclose($file);

Expand Down Expand Up @@ -73,7 +73,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
'type' => 'csrf',
];
$csrfToken = apiSendAndReceive($apiData, $WIKIPEDIA_API_URL, $ABSOLUTE_PATH_TO_TEMP_DIRECTORY)['query']['tokens']['csrftoken'];

// make edit
$apiData = [
'action' => 'edit',
Expand All @@ -95,8 +95,12 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
if ( $fileName === '.' ) continue;
if ( $fileName === '..' ) continue;
if ( $fileName === '.' ) {
continue;
}
if ( $fileName === '..' ) {
continue;
}
$path = $CLASSES_FOLDER_PATH . $fileName;
$classText = file_get_contents($path);
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
Expand Down
1 change: 1 addition & 0 deletions UnblockReview/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ TODO:
let wikitext = data.query.pages[ pageId ].revisions[ 0 ][ '*' ];

// change wikitext
// eslint-disable-next-line no-undef
const unblockReview = new UnblockReview();
const acceptDeclineReason = reasonArea.value;
wikitext = unblockReview.processAcceptOrDecline( wikitext, appealReason, acceptDeclineReason, DEFAULT_DECLINE_REASON, acceptOrDecline );
Expand Down
12 changes: 8 additions & 4 deletions UnblockReview/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function deleteRequireFunctions($str) {

function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_API_URL, $WIKIPEDIA_USERNAME, $WIKIPEDIA_PASSWORD) {
// clear cookies from last session
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die ('Unable to open file!');
$file = fopen($ABSOLUTE_PATH_TO_TEMP_DIRECTORY . '\\cookie.txt', 'w') or die('Unable to open file!');
fwrite($file, '');
fclose($file);

Expand Down Expand Up @@ -73,7 +73,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
'type' => 'csrf',
];
$csrfToken = apiSendAndReceive($apiData, $WIKIPEDIA_API_URL, $ABSOLUTE_PATH_TO_TEMP_DIRECTORY)['query']['tokens']['csrftoken'];

// make edit
$apiData = [
'action' => 'edit',
Expand All @@ -95,8 +95,12 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
if ( $fileName === '.' ) continue;
if ( $fileName === '..' ) continue;
if ( $fileName === '.' ) {
continue;
}
if ( $fileName === '..' ) {
continue;
}
$path = $CLASSES_FOLDER_PATH . $fileName;
$classText = file_get_contents($path);
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
Expand Down

0 comments on commit 20fe823

Please sign in to comment.