<commit_before>#include <QDebug>
#include <QSettings>
#include <QFileInfo>
#include <QDir>
#include <QThread>

#include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <utils/macroexpander.h>

#include "CppcheckRunner.h"
#include "Constants.h"
#include "Settings.h"

using namespace QtcCppcheck::Internal;

namespace
{
  enum ErrorField
  {
    ErrorFieldFile = 0, ErrorFieldLine, ErrorFieldSeverity, ErrorFieldId,
    ErrorFieldMessage
  };

  QStringList includePaths (const QStringList& files)
  {
    QStringList paths;
    foreach (const QString& file, files)
    {
      QFileInfo info (file);
      QString current = QString (QLatin1String("-I")) + info.absolutePath ();
      if (!paths.contains(current))
      {
        paths << current;
      }
    }
    return paths;
  }

}

CppcheckRunner::CppcheckRunner(Settings *settings, QObject *parent) :
  QObject(parent), settings_ (settings), showOutput_ (false), showId_(false), futureInterface_ (NULL),
  maxArgumentsLength_ (0)
{
#ifdef __linux__
  QProcess getConf;
  getConf.start (QLatin1String("getconf ARG_MAX"));
  getConf.waitForFinished (2000);
  QByteArray argMax = getConf.readAllStandardOutput ().replace ("\n", "");
  maxArgumentsLength_ = std::max (argMax.toInt (), 32000);
#else
  maxArgumentsLength_ = 32767;
#endif
  Q_ASSERT (settings_ != NULL);
<commit_msg>Fixed generation of wrong '--includes-file' option's file.<commit_after>#include <QDebug>
#include <QSettings>
#include <QFileInfo>
#include <QDir>
#include <QThread>

#include <coreplugin/messagemanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <utils/macroexpander.h>

#include "CppcheckRunner.h"
#include "Constants.h"
#include "Settings.h"

using namespace QtcCppcheck::Internal;

namespace
{
  enum ErrorField
  {
    ErrorFieldFile = 0, ErrorFieldLine, ErrorFieldSeverity, ErrorFieldId,
    ErrorFieldMessage
  };

  QStringList includePaths (const QStringList& files)
  {
    QStringList paths;
    foreach (const QString& file, files)
    {
      QFileInfo info (file);
      QString current = info.absolutePath ();
      if (!paths.contains(current))
      {
        paths << current;
      }
    }
    return paths;
  }

}

CppcheckRunner::CppcheckRunner(Settings *settings, QObject *parent) :
  QObject(parent), settings_ (settings), showOutput_ (false), showId_(false), futureInterface_ (NULL),
  maxArgumentsLength_ (0)
{
#ifdef __linux__
  QProcess getConf;
  getConf.start (QLatin1String("getconf ARG_MAX"));
  getConf.waitForFinished (2000);
  QByteArray argMax = getConf.readAllStandardOutput ().replace ("\n", "");
  maxArgumentsLength_ = std::max (argMax.toInt (), 32000);
#else
  maxArgumentsLength_ = 32767;
#endif
  Q_ASSERT (settings_ != NULL);

{'fraction_non_alphanumeric': 0.12305025996533796, 'fraction_numerical': 0.012131715771230503, 'mean_word_length': 4.714851485148515, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '623988', 'n_tokens_mistral': 950, 'n_tokens_neox': 931, 'n_words': 206}