CINXE.COM

Sample configuration file | Documentation | SymfonyInsight

<!DOCTYPE html> <html lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="msapplication-tap-highlight" content="no" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="referrer" content="origin" /> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700&amp;display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://insight.symfony.com/build/lib.1f2b2c55.css" /> <link rel="stylesheet" href="https://insight.symfony.com/build/app.67946384.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" /> <style> #doc-search .DocSearch-Button { width: 100%; max-width: 570px; color: #007375; background-color: #ffffff; border: #007375 solid thin; } #doc-search .DocSearch-Search-Icon { color: #007375; } #doc-search .DocSearch-Button-Key { background: #d3e6e7; color: #007375; box-shadow: none; height: 25px; top: 0; margin-right: 3px; padding: 3px; min-width: 25px; } footer { margin-top: 0; } </style> <link rel="stylesheet" href="https://insight.symfony.com/css/docs-builder-theme.css" /> <link href="https://insight.symfony.com/fa/css/all.min.css" rel="stylesheet"> <title>Sample configuration file | Documentation | SymfonyInsight</title> <meta name="description" content="PHP project quality, done right." /> <link rel="apple-touch-icon" sizes="180x180" href="https://insight.symfony.com/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="https://insight.symfony.com/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="https://insight.symfony.com/favicon-16x16.png"> <link rel="manifest" href="https://insight.symfony.com/site.webmanifest"> <link rel="mask-icon" href="https://insight.symfony.com/safari-pinned-tab.svg" color="#5bbad5"> <meta name="msapplication-TileColor" content="#006769"> <meta name="theme-color" content="#ffffff"> <meta property="og:site_name" content="SymfonyInsight" /> <meta property="og:type" content="website" /> <meta property="og:url" content="https://insight.symfony.com" /> <meta property="og:title" content="Sample configuration file | Documentation | SymfonyInsight" /> <meta property="og:description" content="PHP project quality, done right." /> <meta property="og:image" content="https://insight.symfony.com/sharer-default.png" /> <meta property="og:image:width" content="1905" /> <meta property="og:image:height" content="1000" /> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url": "https://insight.symfony.com", "name": "Sample configuration file | Documentation | SymfonyInsight", "description": "PHP project quality, done right.", "funder": { "@type": "Organization", "url": "https://symfony.com", "name": "Symfony" } } </script> <style> .webinar-banner { background: #007375; } .webinar-banner a { display: block; padding: 10px; text-align: center; color: #fff; text-decoration: none; } .webinar-banner a:hover, .webinar-banner a:hover span, .webinar-banner strong { text-decoration: underline; } .webinar-banner span { display: inline-block; padding-right: 15px; color: #fff; } .webinar-banner strong { display: inline-block; padding-left: 15px; } </style> <script async="true" data-browser-key="30e57ea14c0d6fb73470ac106726cfecb7c6278a881a16bd7ebdbbb6794b2e87" data-sample-rate="1.000000" data-parent-trace-id="cb0abdf3ec0210b4cbfbd0e80e11b0a3" data-transaction-name="App\Controller\HelpController::sectionAction" data-collector="https://ingest.blackfire.io" src="https://admin.pipeline.blackfire.io/js/probe.js"></script></head> <body class=""> <div id="sln"></div> <header class="header"> <div class="container"> <div class="row align-items-center"> <div class="col-9 col-md-4 text-left mb-0"> <a href="/" title="Back to home"> <img src="https://insight.symfony.com/insight/img/logo-header.svg" alt="SymfonyInsight logo" class="header-logo" /> </a> </div> <div class="col-3 text-right d-md-none"> <button class="btn btn-link text-primary" id="mobile-menu-button"> <i class="fas fa-bars"></i> </button> </div> <div class="d-none d-md-block col-12 col-md-auto ml-0 ml-md-auto" id="mobile-menu-nav"> <ul class="nav nav-pills mt-3 mt-md-0 flex-column align-items-stretch flex-md-row justify-content-md-start"> <li class="nav-item"> <a class="nav-link " href="https://insight.symfony.com/features"> How does it work? </a> </li> <li class="nav-item"> <a class="nav-link " href="https://insight.symfony.com/what-we-analyse"> What we cover </a> </li> <li class="nav-item"> <a class="nav-link active" href="https://insight.symfony.com/docs"> Documentation </a> </li> <li class="nav-item"> <a class="nav-link " href="https://insight.symfony.com/pricing"> Pricing </a> </li> </ul> </div> </div> </div> </header> <div class="container"> <div class="docs"> <div class="text-center mt-5 mb-5"> <h3>Documentation</h3> <br> <div id="doc-search" class="d-flex justify-content-center"></div> </div> <div class="row docs-page"> <div class="col-lg-3"> <div class="docs-page-menu"> <a href="/docs" class="docs-page-menu-home"> <i class="fa fa-book" aria-hidden="true"></i> <span>Doc index page</span> </a> <div id="documentation-menu"> <ul> <li><p><a href="getting-started.html" class="reference internal">Getting started</a></p> <ul> <li><a href="/docs/getting-started/introduction-to-insight.html" class="reference internal">Introduction to SymfonyInsight</a></li> <li><a href="/docs/getting-started/getting-started-as-a-team.html" class="reference internal">Getting started as a team</a></li> <li><a href="/docs/getting-started/getting-started-as-a-freelancer.html" class="reference internal">Getting started as a freelancer</a></li> <li><a href="/docs/getting-started/configuring-insight.html" class="reference internal">Configuring SymfonyInsight</a></li> </ul></li> <li><ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul></li> <li><ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul></li> <li><ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul></li> <li><p><a href="manager.html" class="reference internal">Using SymfonyInsight as a manager</a></p> <ul> <li><a href="/docs/manager/integrate-symfonyinsight-in-your-workflow.html" class="reference internal">Integrate SymfonyInsight in your workflow</a></li> <li><a href="/docs/manager/configure-emails-alerts.html" class="reference internal">Configure e-mails alerts</a></li> <li><a href="/docs/manager/create-printable-reports.html" class="reference internal">Print executive and full quality reports</a></li> </ul></li> <li><p><a href="notifications.html" class="reference internal">Receive notifications</a></p> <ul> <li><a href="/docs/notifications/receive-slack-notifications.html" class="reference internal">Slack notifications</a></li> <li><a href="/docs/notifications/receive-teams-notifications.html" class="reference internal">Microsoft Teams notifications</a></li> <li><a href="/docs/notifications/receive-hipchat-notifications.html" class="reference internal">HipChat notifications</a></li> <li><a href="/docs/notifications/custom-webhook.html" class="reference internal">Configure a custom WebHook</a></li> </ul></li> <li><p><a href="execution-environment.html" class="reference internal">Execution environment</a></p> <ul> <li><a href="/docs/execution-environment/pre-installed-software-and-tools.html" class="reference internal">Pre-installed software and tools</a></li> <li><a href="/docs/execution-environment/enabling-php-extensions.html" class="reference internal">Enabling PHP extensions</a></li> <li><a href="/docs/execution-environment/installing-npm-packages.html" class="reference internal">Installing npm packages</a></li> <li><a href="/docs/execution-environment/installing-debian-packages.html" class="reference internal">Installing Debian packages</a></li> </ul></li> <li><p><a href="how-to.html" class="reference internal">How-To</a></p> <ul> <li><a href="/docs/how-to/install-private-composer-dependencies.html" class="reference internal">Install private Composer dependencies</a></li> <li><a href="/docs/how-to/analyze-projects-not-accessible-by-insight.html" class="reference internal">Analyze projects not accessible by SymfonyInsight</a></li> <li><a href="/docs/how-to/analyze-projects-not-managed-with-git.html" class="reference internal">Analyze projects not managed with Git</a></li> <li><a href="/docs/how-to/connect-to-a-database.html" class="reference internal">Connect to a database</a></li> <li><a href="/docs/how-to/embed-badges-showing-the-project-medal.html" class="reference internal">Embed badges showing the project medal</a></li> <li><a href="/docs/how-to/select-the-repository-branch-to-analyze.html" class="reference internal">Select the repository branch to analyze</a></li> <li><a href="/docs/how-to/ignore-all-violations-for-a-given-rule.html" class="reference internal">Ingore all violations for a given rule</a></li> <li><a href="/docs/how-to/analyze-a-project-using-git-submodules.html" class="reference internal">Analyze a project using Git submodules</a></li> <li><a href="/docs/how-to/add-collaborators-to-a-project.html" class="reference internal">Add collaborators to a project</a></li> <li><a href="/docs/how-to/configure-in-which-directory-my-code-is-located.html" class="reference internal">Configure in which directory my code is located</a></li> <li><a href="/docs/how-to/ignore-a-specific-file-or-directory.html" class="reference internal">Ignore a specific file or directory</a></li> <li><a href="/docs/how-to/integrate-insight-into-phpstorm.html" class="reference internal">Integrate SymfonyInsight into PHPStorm</a></li> </ul></li> <li><p><a href="troubleshooting.html" class="reference internal">Troubleshooting</a></p> <ul> <li><a href="/docs/troubleshooting/report-a-false-positive.html" class="reference internal">Report a false positive</a></li> <li><a href="/docs/troubleshooting/the-tmp-directory-is-not-writable.html" class="reference internal">The /tmp directory is not writable</a></li> <li><a href="/docs/troubleshooting/my-application-is-not-bootable.html" class="reference internal">My application is not bootable</a></li> </ul></li> <li><p><a href="reference.html" class="reference internal">Reference</a></p> <ul> <li><a href="/docs/reference/configuration-options.html" class="reference internal">Configuration options reference</a></li> <li><a href="/docs/reference/sample-configuration-file.html" class="reference internal">Sample configuration file</a></li> </ul></li> <li><p><a href="privacy-and-security.html" class="reference internal">Privacy and security</a></p> <ul> <li><a href="/docs/privacy-and-security/how-does-insight-manage-private-code.html" class="reference internal">How does SymfonyInsight manage private code?</a></li> <li><a href="/docs/privacy-and-security/what-happens-to-my-code-at-project-deletion.html" class="reference internal">What happens to my code at project deletion?</a></li> </ul></li> </ul> </div> </div> </div> <div class="col-lg-9"> <div class="docs-page-content box-shadow bg-white p-4"> <div class="section"> <h1 id="sample-configuration-file"><a class="headerlink" href="#sample-configuration-file" title="Permalink to this headline">Sample configuration file</a></h1> <p>This article shows a real example of a SymfonyInsight configuration file. Check out the <a href="../../docs/reference/configuration-options.html" class="reference internal">configuration reference</a> to learn more about all config options.</p> <div translate="no" data-loc="44" class="notranslate codeblock codeblock-length-md codeblock-yaml"> <div class="codeblock-scroll"> <pre class="codeblock-lines">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44</pre> <pre class="codeblock-code"><code><span class="hljs-comment"># <span class="hljs-doctag">NOTE:</span> you don't need to include all these options in your own configuration</span> <span class="hljs-comment"># files. Only include the options that make sense in your project.</span> <span class="hljs-comment"># Configure the PHP version SymfonyInsight should use to analyze</span> <span class="hljs-comment"># your project. It can be defined to 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 or 8.3.</span> <span class="hljs-comment"># If not present, it will prefer the latest PHP version.</span> <span class="hljs-attr">php_version:</span> <span class="hljs-number">8.3</span> <span class="hljs-comment"># Configure which PHP extensions your project need to be analyzed.</span> <span class="hljs-attr">php_ini:</span> <span class="hljs-string">| extension=openssl.so extension=mcrypt.so </span> <span class="hljs-comment"># Ignore some branches to avoid triggering analysis for these</span> <span class="hljs-attr">ignore_branches:</span> <span class="hljs-bullet">-</span> <span class="hljs-string">gh-pages</span> <span class="hljs-comment"># Configure the failure conditions for your commit status.</span> <span class="hljs-comment"># If at least one of these conditions is verified, the commit status is displayed as failed.</span> <span class="hljs-attr">commit_failure_conditions:</span> <span class="hljs-bullet">-</span> <span class="hljs-string">"pr.severity.critical &gt; 0"</span> <span class="hljs-bullet">-</span> <span class="hljs-string">"pr.severity.major &gt; 0"</span> <span class="hljs-comment"># Configure rules.</span> <span class="hljs-attr">rules:</span> <span class="hljs-comment"># Disable a rule</span> <span class="hljs-attr">php.duplicated_code:</span> <span class="hljs-attr">enabled:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># Configure a rule</span> <span class="hljs-attr">php.class_too_long:</span> <span class="hljs-attr">max_length:</span> <span class="hljs-number">2000</span> <span class="hljs-attr">threshold:</span> <span class="hljs-number">10</span> <span class="hljs-comment"># Configure in which directory your code is located.</span> <span class="hljs-comment"># This can be set to any subdirectory of your project.</span> <span class="hljs-attr">working_directory:</span> <span class="hljs-string">myapp</span> <span class="hljs-comment"># This section will be executed before installing dependencies.</span> <span class="hljs-comment"># You should configure here what is needed for Composer to run without</span> <span class="hljs-comment"># issue: install libraries, prepare the database, etc.</span> <span class="hljs-attr">pre_composer_script:</span> <span class="hljs-string">| #!/bin/bash sudo apt-get update</span></code></pre> </div> </div> </div> </div> </div> </div> </div> </div> <footer class="footer"> <div class="container text-center"> <div class="pt-5 pb-5"> <div class="mb-1"> <a href="https://insight.symfony.com/features"> How does it work? </a> <a href="https://insight.symfony.com/what-we-analyse"> What we analyze </a> <a href="https://insight.symfony.com/docs"> Documentation </a> <a href="https://insight.symfony.com/pricing"> Pricing </a> </div> <div class="mb-1"> <a href="https://connect.symfony.com/privacy-policy" target="_blank"> Privacy policy </a> <a href="https://insight.symfony.com/terms" target="_blank"> Terms of service </a> </div> <div class="mb-5"> <a href="https://symfony.com/support?product=SLI#products" target="_blank"> Support </a> <a href="https://twitter.com/symfonyinsight" target="_blank"> Follow us on Twitter </a> </div> <img src="https://insight.symfony.com/insight/img/logo-footer.svg" alt="SymfonyInsight logo" class="footer-logo" /> <div class="mt-3"> <small> SymfonyInsight is a trademark of Symfony. All rights reserved. </small> </div> </div> </div> </footer> <script src="https://insight.symfony.com/build/global.b6f1f3cf.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha256-CjSoeELFOcH0/uxWu6mC/Vlrc1AARqbm/jiiImDGV3s=" crossorigin="anonymous"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script> <script type="text/javascript"> docsearch({ appId: 'SLBM2MPP2K', apiKey: 'c4068287268cd5014f5053c8f8d91ee8', indexName: 'insight-symfony', container: '#doc-search', debug: false, }); </script> <script type="text/javascript">var currentUrl = '/docs/reference/sample-configuration-file.html';</script> <script src="https://insight.symfony.com/js/documentation.js"></script> <link rel="stylesheet" href="https://connect.symfony.com/css/sln.css" /> <script src="https://connect.symfony.com/sln.js?customize_url=https://insight.symfony.com/account/sln_customize.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10