From 7026ed78ceffa8525c5333b2cccf571d4b100520 Mon Sep 17 00:00:00 2001 From: Norwid Behrnd Date: Sun, 18 Feb 2024 18:17:05 +0000 Subject: [PATCH 1/8] Translated using Weblate (German) Currently translated at 99.4% (166 of 167 strings) Translation: Avogadro/avogadroapp Translate-URL: https://hosted.weblate.org/projects/avogadro/avogadroapp/de/ Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- i18n/de.po | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/i18n/de.po b/i18n/de.po index df10d813..1d561798 100644 --- a/i18n/de.po +++ b/i18n/de.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: _avogadro-de\n" "Report-Msgid-Bugs-To: avogadro-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2023-12-11 21:00+0000\n" -"PO-Revision-Date: 2024-01-23 16:01+0000\n" +"PO-Revision-Date: 2024-02-19 19:02+0000\n" "Last-Translator: Norwid Behrnd \n" "Language-Team: German \n" @@ -23,7 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.5-dev\n" "X-Launchpad-Export-Date: 2018-04-13 16:02+0000\n" #. i18n: file: aboutdialog.ui:62 @@ -591,8 +591,9 @@ msgstr "Dateien können nicht geöffnet werden" #. i18n: file: mainwindow.ui:49 #. i18n: ectx: property (title), widget (QMenu, menuBuild) #: menubuilder.cpp:79:45 +#, fuzzy msgid "&Build" -msgstr "&Erstellen" +msgstr "S&truktur" #. i18n: file: mainwindow.ui:71 #. i18n: ectx: property (title), widget (QMenu, menuSelect) From ab32821a6d78d8d95f352fa777dffdab286fecba Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 2 Mar 2024 22:19:21 -0500 Subject: [PATCH 2/8] Fix crash when no selection is made when saving files Fixes #479 Signed-off-by: Geoff Hutchison Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index e520f007..4118820d 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -577,7 +577,7 @@ void setDefaultViews(MultiViewWidget* viewWidget) bool anyPluginTrue = false; // load plugins normally, if all non-ignore are false. // restore the default behavior - for (auto plugin : sceneModel->scenePlugins()) { + for (ScenePlugin* plugin : sceneModel->scenePlugins()) { QString settingsKey("MainWindow/" + plugin->objectName()); bool enabled = settings.value(settingsKey, plugin->isEnabled()).toBool(); if (plugin->defaultBehavior() != ScenePlugin::DefaultBehavior::Ignore && @@ -1497,6 +1497,9 @@ bool MainWindow::saveFileAs(bool async) QFileDialog saveDialog(this, tr("Save chemical file"), dir, filter); saveDialog.setAcceptMode(QFileDialog::AcceptSave); saveDialog.exec(); + if (saveDialog.selectedFiles().isEmpty()) // user cancel + return false; + QString fileName = saveDialog.selectedFiles().first(); if (fileName.isEmpty()) // user cancel From 7744e098741fba937f47ebd8835648459448f5f4 Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Fri, 29 Mar 2024 10:48:17 +0530 Subject: [PATCH 3/8] AutoSave Feature Implemented Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 38 +++++++++++++++++++++++++++++++++++++- avogadro/mainwindow.h | 8 +++++--- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index 4118820d..5a6c94c7 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -1979,6 +1979,42 @@ void MainWindow::buildMenu() m_menuBuilder->addAction(path, action, 960); m_fileToolBar->addAction(action); connect(action, SIGNAL(triggered()), SLOT(saveFileAs())); + // Initialize autosave feature +m_autosaveInterval = 5; // Autosave interval in minutes +m_autosaveTimer = new QTimer(this); +connect(m_autosaveTimer, &QTimer::timeout, this, &MainWindow::autosaveDocument); +m_autosaveTimer->start(m_autosaveInterval * 60000); // Convert minutes to milliseconds + +void MainWindow::autosaveDocument() +{ + if (!m_molecule || !m_moleculeDirty) { + return; // No molecule loaded or no changes made since the last save. + } + + QString autosaveDirPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/autosave"; + QDir autosaveDir(autosaveDirPath); + if (!autosaveDir.exists()) { + autosaveDir.mkpath("."); + } + + // Construct autosave file name + QString autosaveFilename; + if (m_molecule->hasData("fileName")) { + QFileInfo fileInfo(m_molecule->data("fileName").toString().c_str()); + autosaveFilename = fileInfo.baseName() + "_autosave.cjson"; + } else { + autosaveFilename = "unsaved_autosave.cjson"; + } + QString autosaveFilePath = autosaveDirPath + "/" + autosaveFilename; + + // Use CJSON format for autosaving + Io::CjsonFormat writer; + if (!writer.writeFile(autosaveFilePath, *m_molecule)) { + qWarning() << "Failed to autosave the document to" << autosaveFilePath; + } else { + qDebug() << "Document autosaved to" << autosaveFilePath; + } +} // Export action for menu QStringList exportPath = path; @@ -2635,4 +2671,4 @@ bool MainWindow::handleCommand(const QString& command, return false; } -} // End of Avogadro namespace +} // End of Avogadro namespace \ No newline at end of file diff --git a/avogadro/mainwindow.h b/avogadro/mainwindow.h index 3dadf613..e2125d1c 100644 --- a/avogadro/mainwindow.h +++ b/avogadro/mainwindow.h @@ -69,7 +69,7 @@ class MainWindow : public QMainWindow public slots: void setMolecule(Avogadro::QtGui::Molecule* molecule); - + void autosaveDocument(); //line to declare the autosave slot /** * Update internal state to reflect that the molecule has been modified. */ @@ -391,6 +391,7 @@ private slots: void setProjectionPerspective(); private: + QtGui::Molecule* m_molecule; QtGui::RWMolecule* m_rwMolecule; QtGui::MoleculeModel* m_moleculeModel; @@ -398,7 +399,8 @@ private slots: QtGui::ScenePlugin* m_activeScenePlugin; bool m_queuedFilesStarted; QStringList m_queuedFiles; - + QTimer* m_autosaveTimer; // for the autosave timer + int m_autosaveInterval; // for autosave interval in minutes QStringList m_recentFiles; QList m_actionRecentFiles; @@ -502,4 +504,4 @@ private slots: } // End Avogadro namespace -#endif +#endif \ No newline at end of file From cf7d0ac7615b6eb996952472c74a3927a4515f4c Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Sat, 13 Apr 2024 18:20:38 +0530 Subject: [PATCH 4/8] Apply clang-format corrections Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 36 ++++++++++++++++++++---------------- avogadro/mainwindow.h | 7 +++---- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index 5a6c94c7..c019f0fc 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -1980,41 +1980,45 @@ void MainWindow::buildMenu() m_fileToolBar->addAction(action); connect(action, SIGNAL(triggered()), SLOT(saveFileAs())); // Initialize autosave feature -m_autosaveInterval = 5; // Autosave interval in minutes -m_autosaveTimer = new QTimer(this); -connect(m_autosaveTimer, &QTimer::timeout, this, &MainWindow::autosaveDocument); -m_autosaveTimer->start(m_autosaveInterval * 60000); // Convert minutes to milliseconds - -void MainWindow::autosaveDocument() -{ + m_autosaveInterval = 5; // Autosave interval in minutes + m_autosaveTimer = new QTimer(this); + connect(m_autosaveTimer, &QTimer::timeout, this, + &MainWindow::autosaveDocument); + m_autosaveTimer->start(m_autosaveInterval * + 60000); // Convert minutes to milliseconds + + void MainWindow::autosaveDocument() + { if (!m_molecule || !m_moleculeDirty) { - return; // No molecule loaded or no changes made since the last save. + return; // No molecule loaded or no changes made since the last save. } - QString autosaveDirPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/autosave"; + QString autosaveDirPath = + QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + + "/autosave"; QDir autosaveDir(autosaveDirPath); if (!autosaveDir.exists()) { - autosaveDir.mkpath("."); + autosaveDir.mkpath("."); } // Construct autosave file name QString autosaveFilename; if (m_molecule->hasData("fileName")) { - QFileInfo fileInfo(m_molecule->data("fileName").toString().c_str()); - autosaveFilename = fileInfo.baseName() + "_autosave.cjson"; + QFileInfo fileInfo(m_molecule->data("fileName").toString().c_str()); + autosaveFilename = fileInfo.baseName() + "_autosave.cjson"; } else { - autosaveFilename = "unsaved_autosave.cjson"; + autosaveFilename = "unsaved_autosave.cjson"; } QString autosaveFilePath = autosaveDirPath + "/" + autosaveFilename; // Use CJSON format for autosaving Io::CjsonFormat writer; if (!writer.writeFile(autosaveFilePath, *m_molecule)) { - qWarning() << "Failed to autosave the document to" << autosaveFilePath; + qWarning() << "Failed to autosave the document to" << autosaveFilePath; } else { - qDebug() << "Document autosaved to" << autosaveFilePath; + qDebug() << "Document autosaved to" << autosaveFilePath; } -} + } // Export action for menu QStringList exportPath = path; diff --git a/avogadro/mainwindow.h b/avogadro/mainwindow.h index e2125d1c..a33b06ae 100644 --- a/avogadro/mainwindow.h +++ b/avogadro/mainwindow.h @@ -69,7 +69,7 @@ class MainWindow : public QMainWindow public slots: void setMolecule(Avogadro::QtGui::Molecule* molecule); - void autosaveDocument(); //line to declare the autosave slot + void autosaveDocument(); // line to declare the autosave slot /** * Update internal state to reflect that the molecule has been modified. */ @@ -391,7 +391,6 @@ private slots: void setProjectionPerspective(); private: - QtGui::Molecule* m_molecule; QtGui::RWMolecule* m_rwMolecule; QtGui::MoleculeModel* m_moleculeModel; @@ -399,8 +398,8 @@ private slots: QtGui::ScenePlugin* m_activeScenePlugin; bool m_queuedFilesStarted; QStringList m_queuedFiles; - QTimer* m_autosaveTimer; // for the autosave timer - int m_autosaveInterval; // for autosave interval in minutes + QTimer* m_autosaveTimer; // for the autosave timer + int m_autosaveInterval; // for autosave interval in minutes QStringList m_recentFiles; QList m_actionRecentFiles; From 0aba64cb7cfc26e66efa690179eaa0c44d83180c Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Fri, 29 Mar 2024 23:25:33 +0530 Subject: [PATCH 5/8] drag from implemented Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index c019f0fc..6abcde08 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -522,26 +522,30 @@ void MainWindow::dragEnterEvent(QDragEnterEvent* event) else event->ignore(); } - void MainWindow::dropEvent(QDropEvent* event) { - if (event->mimeData()->hasUrls()) { - // TODO: check for ZIP, TAR, PY scripts (plugins) - foreach (const QUrl& url, event->mimeData()->urls()) { - if (url.isLocalFile()) { - QString fileName = url.toLocalFile(); - QFileInfo info(fileName); - QString extension = info.completeSuffix(); // e.g. .tar.gz or .pdb.gz + const QMimeData* mimeData = event->mimeData(); - if (extension == "py") - addScript(fileName); - else - openFile(fileName); - } + if (mimeData->hasUrls()) { + QList urlList = mimeData->urls(); + . + for (int i = 0; i < urlList.size() && i < 10; ++i) { + QString filePath = urlList.at(i).toLocalFile(); + openFile(filePath); } event->acceptProposedAction(); - } else + } + + else if (mimeData->hasText()) { + + QString textData = mimeData->text(); + + event->acceptProposedAction(); + } + + else { event->ignore(); + } } void MainWindow::moleculeReady(int) From c8d21fdb92f8d9dbb03fb67c8cb313e510c41493 Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:44:54 +0530 Subject: [PATCH 6/8] updates Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 79 +++++++++++++++++++++++++++++++---------- avogadro/mainwindow.h | 8 ++++- 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index 6abcde08..a767cd1a 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -50,7 +50,7 @@ #include #include #include - +#include #include #include #include @@ -228,6 +228,7 @@ using VTK::vtkGLWidget; #endif MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings) + : QMainWindow(/* parent */), dragStartPosition() : m_molecule(nullptr) , m_rwMolecule(nullptr) , m_moleculeModel(nullptr) @@ -357,6 +358,47 @@ MainWindow::~MainWindow() delete m_viewFactory; } +void MainWindow::mousePressEvent(QMouseEvent* event) +{ + if (event->button() == Qt::LeftButton) + dragStartPosition = event->pos(); +} + +void MainWindow::mouseMoveEvent(QMouseEvent* event) +{ + if (!(event->buttons() & Qt::LeftButton)) + return; + if ((event->pos() - dragStartPosition).manhattanLength() < QApplication::startDragDistance()) + return; + + performDrag(); +} + +void MainWindow::performDrag() +{ + // Assuming you have a method to get the currently selected molecule as a string in a specific format + QString moleculeData = /* method to get molecule data */; + if (moleculeData.isEmpty()) + return; + + auto* mimeData = new QMimeData; + mimeData->setText(moleculeData); // For demonstration, using plain text. Adjust based on actual data format. + + // Create a drag object + auto* drag = new QDrag(this); + drag->setMimeData(mimeData); + + // You can set an appropriate pixmap for the drag object if you like + // QPixmap pixmap(iconSize); + // QPainter painter(&pixmap); + // painter.drawPixmap(QPoint(), /* your pixmap here */); + // painter.end(); + // drag->setPixmap(pixmap); + + // Execute the drag operation + drag->exec(Qt::CopyAction | Qt::MoveAction); +} + void MainWindow::setupInterface() { // We take care of setting up the main interface here, along with any custom @@ -524,30 +566,29 @@ void MainWindow::dragEnterEvent(QDragEnterEvent* event) } void MainWindow::dropEvent(QDropEvent* event) { - const QMimeData* mimeData = event->mimeData(); - - if (mimeData->hasUrls()) { - QList urlList = mimeData->urls(); - . - for (int i = 0; i < urlList.size() && i < 10; ++i) { - QString filePath = urlList.at(i).toLocalFile(); - openFile(filePath); + if (event->mimeData()->hasUrls()) { + QList urls = event->mimeData()->urls(); + for (const QUrl &url : urls) { + if (url.isLocalFile()) { + QString fileName = url.toLocalFile(); + QFileInfo info(fileName); + + // Distinguish Python scripts for special handling + if (info.suffix().compare("py", Qt::CaseInsensitive) == 0) { + addScript(fileName); + } else { + + openFile(fileName); + } + } } event->acceptProposedAction(); - } - - else if (mimeData->hasText()) { - - QString textData = mimeData->text(); - - event->acceptProposedAction(); - } - - else { + } else { event->ignore(); } } + void MainWindow::moleculeReady(int) { auto* extension = qobject_cast(sender()); diff --git a/avogadro/mainwindow.h b/avogadro/mainwindow.h index a33b06ae..9cf835c0 100644 --- a/avogadro/mainwindow.h +++ b/avogadro/mainwindow.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include #ifdef QTTESTING class pqTestUtility; @@ -161,6 +163,9 @@ public slots: void moleculeChanged(QtGui::Molecule* molecue); protected: + void mousePressEvent(QMouseEvent* event) override; + void mouseMoveEvent(QMouseEvent* event) override; + void closeEvent(QCloseEvent* event); // Handle drag and drop -- accept files dragged on the window @@ -391,6 +396,7 @@ private slots: void setProjectionPerspective(); private: +QPoint dragStartPosition; // To store the start position of a drag operation QtGui::Molecule* m_molecule; QtGui::RWMolecule* m_rwMolecule; QtGui::MoleculeModel* m_moleculeModel; @@ -479,7 +485,7 @@ private slots: * Initialize the tool plugins. */ void buildTools(); - + void performDrag(); /** * Convenience function that converts a file extension to a wildcard * expression, e.g. "out" to "*.out". This method also checks for "extensions" From 38ed8b47896a5e7a8b59ba2dce9a97c68ccd8e52 Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:03:57 +0530 Subject: [PATCH 7/8] modified for clang format Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- avogadro/mainwindow.cpp | 25 ++++++++++++++----------- avogadro/mainwindow.h | 10 +++++----- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index a767cd1a..68b7f270 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -38,6 +38,8 @@ #include #include +#include +#include #include #include #include @@ -50,8 +52,6 @@ #include #include #include -#include -#include #include #include #include @@ -228,7 +228,8 @@ using VTK::vtkGLWidget; #endif MainWindow::MainWindow(const QStringList& fileNames, bool disableSettings) - : QMainWindow(/* parent */), dragStartPosition() + : QMainWindow(/* parent */) + , dragStartPosition() : m_molecule(nullptr) , m_rwMolecule(nullptr) , m_moleculeModel(nullptr) @@ -368,7 +369,8 @@ void MainWindow::mouseMoveEvent(QMouseEvent* event) { if (!(event->buttons() & Qt::LeftButton)) return; - if ((event->pos() - dragStartPosition).manhattanLength() < QApplication::startDragDistance()) + if ((event->pos() - dragStartPosition).manhattanLength() < + QApplication::startDragDistance()) return; performDrag(); @@ -376,18 +378,20 @@ void MainWindow::mouseMoveEvent(QMouseEvent* event) void MainWindow::performDrag() { - // Assuming you have a method to get the currently selected molecule as a string in a specific format + // Assuming you have a method to get the currently selected molecule as a + // string in a specific format QString moleculeData = /* method to get molecule data */; if (moleculeData.isEmpty()) return; auto* mimeData = new QMimeData; - mimeData->setText(moleculeData); // For demonstration, using plain text. Adjust based on actual data format. + mimeData->setText(moleculeData); // For demonstration, using plain text. + // Adjust based on actual data format. // Create a drag object auto* drag = new QDrag(this); drag->setMimeData(mimeData); - + // You can set an appropriate pixmap for the drag object if you like // QPixmap pixmap(iconSize); // QPainter painter(&pixmap); @@ -568,16 +572,16 @@ void MainWindow::dropEvent(QDropEvent* event) { if (event->mimeData()->hasUrls()) { QList urls = event->mimeData()->urls(); - for (const QUrl &url : urls) { + for (const QUrl& url : urls) { if (url.isLocalFile()) { QString fileName = url.toLocalFile(); QFileInfo info(fileName); - + // Distinguish Python scripts for special handling if (info.suffix().compare("py", Qt::CaseInsensitive) == 0) { addScript(fileName); } else { - + openFile(fileName); } } @@ -588,7 +592,6 @@ void MainWindow::dropEvent(QDropEvent* event) } } - void MainWindow::moleculeReady(int) { auto* extension = qobject_cast(sender()); diff --git a/avogadro/mainwindow.h b/avogadro/mainwindow.h index 9cf835c0..26d633ba 100644 --- a/avogadro/mainwindow.h +++ b/avogadro/mainwindow.h @@ -6,11 +6,11 @@ #ifndef AVOGADRO_MAINWINDOW_H #define AVOGADRO_MAINWINDOW_H +#include +#include #include #include #include -#include -#include #ifdef QTTESTING class pqTestUtility; @@ -163,7 +163,7 @@ public slots: void moleculeChanged(QtGui::Molecule* molecue); protected: - void mousePressEvent(QMouseEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override; void closeEvent(QCloseEvent* event); @@ -396,7 +396,7 @@ private slots: void setProjectionPerspective(); private: -QPoint dragStartPosition; // To store the start position of a drag operation + QPoint dragStartPosition; // To store the start position of a drag operation QtGui::Molecule* m_molecule; QtGui::RWMolecule* m_rwMolecule; QtGui::MoleculeModel* m_moleculeModel; @@ -485,7 +485,7 @@ QPoint dragStartPosition; // To store the start position of a drag operation * Initialize the tool plugins. */ void buildTools(); - void performDrag(); + void performDrag(); /** * Convenience function that converts a file extension to a wildcard * expression, e.g. "out" to "*.out". This method also checks for "extensions" From f13fe369616f8c6336ceb3835b2b19e616ec4a7b Mon Sep 17 00:00:00 2001 From: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> Date: Thu, 18 Apr 2024 04:11:43 +0530 Subject: [PATCH 8/8] changes to pass checks Signed-off-by: Vinayakjeet Singh Karki <139736674+vinayakjeet@users.noreply.github.com> --- .github/workflows/codacy.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 0b061851..0730af9b 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -53,13 +53,17 @@ jobs: # This will handover control about PR rejection to the GitHub side max-allowed-issues: 2147483647 - - name: Filter out MISRA + # Filter out MISRA and potentially reduce the number of runs in the SARIF output + - name: Filter and Reduce SARIF run: | pip install globber - python3 scripts/filter_sarif.py --input results.sarif --output filtered.sarif --split-lines -- "-**/*.*:cppcheck_misra*" + python3 scripts/filter_and_reduce_sarif.py --input results.sarif --output filtered_and_reduced.sarif + env: + PYTHONUNBUFFERED: 1 - # Upload the SARIF file generated in the previous step + + # Upload the SARIF file generated in the previous step - name: Upload SARIF results file uses: github/codeql-action/upload-sarif@v3 with: - sarif_file: filtered.sarif + sarif_file: filtered_and_reduced.sarif \ No newline at end of file