OC.L10N.register(
    "lib",
    {
    "Cannot write into \"config\" directory!" : "Não é possível gravar no directório \"config\"!",
    "See %s" : "Ver %s",
    "Sample configuration detected" : "Detetado exemplo de configuração",
    "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Foi detectado que a configuração de amostra foi copiada. Isso pode danificar a sua instalação e não é suportado. Por favor, leia a documentação antes de realizar mudanças no config.php",
    "Email verification" : "Verificação de e-mail",
    "Click the following button to confirm your email." : "Clique no botão a seguir para confirmar o seu e-mail.",
    "Click the following link to confirm your email." : "Clique na hiperligação a seguir para confirmar o seu e-mail.",
    "Confirm your email" : "Confirmar o seu e-mail",
    "Other activities" : "Outras atividades",
    "%1$s and %2$s" : "%1$s e %2$s",
    "%1$s, %2$s and %3$s" : "%1$s, %2$s e %3$s",
    "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s e %4$s",
    "%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s e %5$s",
    "Education Edition" : "Edição Educação",
    "Enterprise bundle" : "Pacote Empresa",
    "Groupware bundle" : "Pacote Colaborativo",
    "Social sharing bundle" : "Pacote Partilha Social",
    "PHP %s or higher is required." : "Necessário PHP %s ou superior.",
    "PHP with a version lower than %s is required." : "É necessário um PHP com uma versão inferir a %s.",
    "%sbit or higher PHP required." : "Necessário PHP %sbit ou superior.",
    "The following architectures are supported: %s" : "As seguintes arquiteturas são suportadas: %s",
    "The following databases are supported: %s" : "As seguintes bases de dados são suportadas: %s",
    "The command line tool %s could not be found" : "Não foi encontrada a ferramenta de linha de comando %s",
    "The library %s is not available." : "A biblioteca %s não está disponível.",
    "The following platforms are supported: %s" : "As seguintes plataformas são suportadas: %s",
    "Server version %s or higher is required." : "É necessária versão do servidor %s or superior. ",
    "Server version %s or lower is required." : "É necessária versão do servidor %s or inferior.",
    "Logged in user must be an admin or sub admin" : "O utilizador autenticado tem de ser um administrador ou subadministrador",
    "Logged in user must be an admin" : "O utilizador autenticado tem de ser um administrador",
    "Authentication" : "Autenticação",
    "Unknown filetype" : "Tipo de ficheiro desconhecido",
    "Invalid image" : "Imagem inválida",
    "Avatar image is not square" : "A imagem do avatar não é quadrada.",
    "View profile" : "Visualizar perfil",
    "today" : "hoje",
    "tomorrow" : "Amanhã",
    "yesterday" : "ontem",
    "_in %n day_::_in %n days_" : ["em %n dia","em %n dias","em %n dias"],
    "_%n day ago_::_%n days ago_" : ["%n dia atrás","%n dias atrás","%n dias atrás"],
    "next month" : "Próximo mês",
    "last month" : "ultimo mês",
    "_in %n month_::_in %n months_" : ["em %n mês","em %n meses","em %n meses"],
    "_%n month ago_::_%n months ago_" : ["%n mês atrás","%n meses atrás","%n meses atrás"],
    "next year" : "Próximo ano",
    "last year" : "ano passado",
    "_in %n year_::_in %n years_" : ["dentro de%n ano","dentro de %n anos","dentro de %n anos"],
    "_%n year ago_::_%n years ago_" : ["%n ano atrás","%n anos atrás","%n anos atrás"],
    "_in %n hour_::_in %n hours_" : ["dentro de %n hora","dentro de %n horas","dentro de %n horas"],
    "_%n hour ago_::_%n hours ago_" : ["%n hora atrás","%n horas atrás","%n horas atrás"],
    "_in %n minute_::_in %n minutes_" : ["dentro de %n minuto","dentro de %n minutos","dentro de %n minutos"],
    "_%n minute ago_::_%n minutes ago_" : ["%n minuto atrás","%n minutos atrás","%n minutos atrás"],
    "in a few seconds" : "em breves segundos",
    "seconds ago" : "Minutos atrás",
    "Empty file" : "Ficheiro vazio",
    "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Módulo com ID: %s não existe. Por favor active-o nas definições da aplicação ou contacte o administrador.",
    "File already exists" : "O ficheiro já existe",
    "Invalid path" : "Caminho inválido!",
    "Failed to create file from template" : "Erro ao criar o ficheiro a partir do modelo",
    "Templates" : "Modelos",
    "File name is a reserved word" : "Nome de ficheiro é uma palavra reservada",
    "File name contains at least one invalid character" : "Nome de ficheiro contém pelo menos um caráter inválido",
    "File name is too long" : "Nome do ficheiro demasiado longo",
    "Dot files are not allowed" : "Ficheiros dot não são permitidos",
    "Empty filename is not allowed" : "Não é permitido um ficheiro sem nome",
    "App \"%s\" cannot be installed because appinfo file cannot be read." : "A app \"%s\" não pode ser instalada porque o ficheiro appinfo não pode ser lido.",
    "App \"%s\" cannot be installed because it is not compatible with this version of the server." : "A aplicação \"%s\" não pode ser instada porque não é compatível com esta versão do servidor.",
    "__language_name__" : "Português",
    "This is an automatically sent email, please do not reply." : "Este e-mail foi enviado automaticamente, por favor não responda a este e-mail.",
    "Help" : "Ajuda",
    "Apps" : "Apps",
    "Settings" : "Definições",
    "Log out" : "Sair",
    "Users" : "Utilizadores",
    "Email" : "E-mail",
    "Mail %s" : "Mensagem para %s",
    "Phone" : "Telefone",
    "Call %s" : "Ligar a %s",
    "Twitter" : "Twitter",
    "View %s on Twitter" : "Visualizar %s no Twitter",
    "Website" : "Website",
    "Visit %s" : "Visite %s",
    "Address" : "Endereço",
    "Profile picture" : "Imagem do perfil",
    "About" : "Sobre",
    "Full name" : "Nome completo",
    "Headline" : "Título ",
    "Organisation" : "Organização",
    "Role" : "Função",
    "Unknown user" : "Utilizador desconhecido",
    "Additional settings" : "Definições adicionais",
    "%s enter the database username and name." : "%s introduza o nome de utilizador da base de dados e o nome da base de dados.",
    "%s enter the database username." : "%s introduza o nome de utilizador da base de dados",
    "%s enter the database name." : "%s introduza o nome da base de dados",
    "%s you may not use dots in the database name" : "%s não é permitido utilizar pontos (.) no nome da base de dados",
    "You need to enter details of an existing account." : "Precisa de introduzir detalhes de uma conta existente.",
    "Oracle connection could not be established" : "Não foi possível estabelecer a ligação Oracle",
    "Oracle username and/or password not valid" : "Nome de utilizador/palavra-passe do Oracle inválidos",
    "PostgreSQL username and/or password not valid" : "Nome de utilizador/password do PostgreSQL inválidos",
    "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Esta plataforma não suporta o sistema operativo Mac OS X e o %s poderá não funcionar correctamente. Utilize por sua conta e risco.",
    "For the best results, please consider using a GNU/Linux server instead." : "Para um melhor resultado, utilize antes o servidor GNU/Linux.",
    "It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged." : "Parece que a instância %s está a ser executada num ambiente PHP de 32-bits e o open_basedir foi configurado no php.ini. Isto levará a problemas com ficheiros de tamanho superior a 4 GB e é altamente desencorajado.",
    "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "Por favor, remova a definição open_basedir do seu php.ini ou altere o seu PHP para 64-bits.",
    "Set an admin username." : "Definir um nome de utilizador de administrador",
    "Set an admin password." : "Definia uma palavra-passe de administrador.",
    "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Ao partilhar a interface %s deve implementar a interface OCP\\Share_Backend",
    "Sharing backend %s not found" : "Não foi encontrada a partilha da interface %s",
    "Sharing backend for %s not found" : "Não foi encontrada a partilha da interface para %s",
    "%1$s shared »%2$s« with you and wants to add:" : "%1$s partilhado »%2$s« consigo e quer adicionar:",
    "%1$s shared »%2$s« with you and wants to add" : "%1$s partilhado »%2$s« consigo e quer adicionar:",
    "»%s« added a note to a file shared with you" : "»%s« adicionou uma nota a um ficheiro partilhado consigo",
    "Open »%s«" : "Abrir »%s«",
    "%1$s via %2$s" : "%1$s via %2$s",
    "You are not allowed to share %s" : "Não está autorizado a partilhar %s",
    "Cannot increase permissions of %s" : "Não é possível aumentar as permissões de %s",
    "Expiration date is in the past" : "A data de expiração está no passado",
    "Sharing %s failed, because this item is already shared with user %s" : "A partilha de %s falhou, porque este item já está a ser partilhado com o utilizador %s",
    "%1$s shared »%2$s« with you" : "%1$s partilhado »%2$s« contigo",
    "%1$s shared »%2$s« with you." : "%1$s partilhado »%2$s« contigo.",
    "Click the button below to open it." : "Clicar no botão abaixo para abrir.",
    "The requested share does not exist anymore" : "A partilha requisitada já não existe",
    "Could not find category \"%s\"" : "Não foi encontrado a categoria \"%s\"",
    "Sunday" : "Domingo",
    "Monday" : "Segunda-feira",
    "Tuesday" : "Terça-feira",
    "Wednesday" : "Quarta-feira",
    "Thursday" : "Quinta-feira",
    "Friday" : "Sexta-feira",
    "Saturday" : "Sábado",
<style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="c1">// Copyright 2020 The Gitea Authors. All rights reserved.</span>
<span class="c1">// Use of this source code is governed by a MIT-style</span>
<span class="c1">// license that can be found in the LICENSE file.</span>

<span class="c1">//go:build gogit</span>
<span class="c1">// +build gogit</span>

<span class="kn">package</span><span class="w"> </span><span class="nx">git</span>

<span class="kn">import</span><span class="w"> </span><span class="p">(</span>
<span class="w">	</span><span class="s">&quot;bytes&quot;</span>
<span class="w">	</span><span class="s">&quot;context&quot;</span>
<span class="w">	</span><span class="s">&quot;io&quot;</span>
<span class="w">	</span><span class="s">&quot;io/ioutil&quot;</span>

<span class="w">	</span><span class="s">&quot;code.gitea.io/gitea/modules/analyze&quot;</span>
<span class="w">	</span><span class="s">&quot;code.gitea.io/gitea/modules/log&quot;</span>

<span class="w">	</span><span class="s">&quot;github.com/go-enry/go-enry/v2&quot;</span>
<span class="w">	</span><span class="s">&quot;github.com/go-git/go-git/v5&quot;</span>
<span class="w">	</span><span class="s">&quot;github.com/go-git/go-git/v5/plumbing&quot;</span>
<span class="w">	</span><span class="s">&quot;github.com/go-git/go-git/v5/plumbing/object&quot;</span>
<span class="p">)</span>

<span class="c1">// GetLanguageStats calculates language stats for git repository at specified commit</span>
<span class="kd">func</span><span class="w"> </span><span class="p">(</span><span class="nx">repo</span><span class="w"> </span><span class="o">*</span><span class="nx">Repository</span><span class="p">)</span><span class="w"> </span><span class="nx">GetLanguageStats</span><span class="p">(</span><span class="nx">commitID</span><span class="w"> </span><span class="kt">string</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kt">int64</span><span class="p">,</span><span class="w"> </span><span class="kt">error</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">	</span><span class="nx">r</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">git</span><span class="p">.</span><span class="nx">PlainOpen</span><span class="p">(</span><span class="nx">repo</span><span class="p">.</span><span class="nx">Path</span><span class="p">)</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="nx">rev</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">r</span><span class="p">.</span><span class="nx">ResolveRevision</span><span class="p">(</span><span class="nx">plumbing</span><span class="p">.</span><span class="nx">Revision</span><span class="p">(</span><span class="nx">commitID</span><span class="p">))</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="nx">commit</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">r</span><span class="p">.</span><span class="nx">CommitObject</span><span class="p">(</span><span class="o">*</span><span class="nx">rev</span><span class="p">)</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="nx">tree</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">commit</span><span class="p">.</span><span class="nx">Tree</span><span class="p">()</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="kd">var</span><span class="w"> </span><span class="nx">checker</span><span class="w"> </span><span class="o">*</span><span class="nx">CheckAttributeReader</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">CheckGitVersionAtLeast</span><span class="p">(</span><span class="s">&quot;1.7.8&quot;</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="nx">indexFilename</span><span class="p">,</span><span class="w"> </span><span class="nx">deleteTemporaryFile</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">repo</span><span class="p">.</span><span class="nx">ReadTreeToTemporaryIndex</span><span class="p">(</span><span class="nx">commitID</span><span class="p">)</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="k">defer</span><span class="w"> </span><span class="nx">deleteTemporaryFile</span><span class="p">()</span>

<span class="w">			</span><span class="nx">checker</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">CheckAttributeReader</span><span class="p">{</span>
<span class="w">				</span><span class="nx">Attributes</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="kt">string</span><span class="p">{</span><span class="s">&quot;linguist-vendored&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;linguist-generated&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;linguist-language&quot;</span><span class="p">},</span>
<span class="w">				</span><span class="nx">Repo</span><span class="p">:</span><span class="w">       </span><span class="nx">repo</span><span class="p">,</span>
<span class="w">				</span><span class="nx">IndexFile</span><span class="p">:</span><span class="w">  </span><span class="nx">indexFilename</span><span class="p">,</span>
<span class="w">			</span><span class="p">}</span>
<span class="w">			</span><span class="nx">ctx</span><span class="p">,</span><span class="w"> </span><span class="nx">cancel</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">context</span><span class="p">.</span><span class="nx">WithCancel</span><span class="p">(</span><span class="nx">DefaultContext</span><span class="p">)</span>
<span class="w">			</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">checker</span><span class="p">.</span><span class="nx">Init</span><span class="p">(</span><span class="nx">ctx</span><span class="p">);</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">				</span><span class="nx">log</span><span class="p">.</span><span class="nx">Error</span><span class="p">(</span><span class="s">&quot;Unable to open checker for %s. Error: %v&quot;</span><span class="p">,</span><span class="w"> </span><span class="nx">commitID</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="p">)</span>
<span class="w">			</span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w">				</span><span class="k">go</span><span class="w"> </span><span class="kd">func</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w">					</span><span class="nx">err</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">checker</span><span class="p">.</span><span class="nx">Run</span><span class="p">()</span>
<span class="w">					</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">						</span><span class="nx">log</span><span class="p">.</span><span class="nx">Error</span><span class="p">(</span><span class="s">&quot;Unable to open checker for %s. Error: %v&quot;</span><span class="p">,</span><span class="w"> </span><span class="nx">commitID</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="p">)</span>
<span class="w">						</span><span class="nx">cancel</span><span class="p">()</span>
<span class="w">					</span><span class="p">}</span>
<span class="w">				</span><span class="p">}()</span>
<span class="w">			</span><span class="p">}</span>
<span class="w">			</span><span class="k">defer</span><span class="w"> </span><span class="nx">cancel</span><span class="p">()</span>
<span class="w">		</span><span class="p">}</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="nx">sizes</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kt">int64</span><span class="p">)</span>
<span class="w">	</span><span class="nx">err</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">tree</span><span class="p">.</span><span class="nx">Files</span><span class="p">().</span><span class="nx">ForEach</span><span class="p">(</span><span class="kd">func</span><span class="p">(</span><span class="nx">f</span><span class="w"> </span><span class="o">*</span><span class="nx">object</span><span class="p">.</span><span class="nx">File</span><span class="p">)</span><span class="w"> </span><span class="kt">error</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Size</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="nx">notVendored</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="kc">false</span>
<span class="w">		</span><span class="nx">notGenerated</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="kc">false</span>

<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">checker</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="nx">attrs</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">checker</span><span class="p">.</span><span class="nx">CheckPath</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">)</span>
<span class="w">			</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">				</span><span class="k">if</span><span class="w"> </span><span class="nx">vendored</span><span class="p">,</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">attrs</span><span class="p">[</span><span class="s">&quot;linguist-vendored&quot;</span><span class="p">];</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="p">{</span>
<span class="w">					</span><span class="k">if</span><span class="w"> </span><span class="nx">vendored</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;set&quot;</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nx">vendored</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;true&quot;</span><span class="w"> </span><span class="p">{</span>
<span class="w">						</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">					</span><span class="p">}</span>
<span class="w">					</span><span class="nx">notVendored</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">vendored</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;false&quot;</span>
<span class="w">				</span><span class="p">}</span>
<span class="w">				</span><span class="k">if</span><span class="w"> </span><span class="nx">generated</span><span class="p">,</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">attrs</span><span class="p">[</span><span class="s">&quot;linguist-generated&quot;</span><span class="p">];</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="p">{</span>
<span class="w">					</span><span class="k">if</span><span class="w"> </span><span class="nx">generated</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;set&quot;</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nx">generated</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;true&quot;</span><span class="w"> </span><span class="p">{</span>
<span class="w">						</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">					</span><span class="p">}</span>
<span class="w">					</span><span class="nx">notGenerated</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">generated</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;false&quot;</span>
<span class="w">				</span><span class="p">}</span>
<span class="w">				</span><span class="k">if</span><span class="w"> </span><span class="nx">language</span><span class="p">,</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">attrs</span><span class="p">[</span><span class="s">&quot;linguist-language&quot;</span><span class="p">];</span><span class="w"> </span><span class="nx">has</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">language</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="s">&quot;unspecified&quot;</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">language</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="w"> </span><span class="p">{</span>
<span class="w">					</span><span class="c1">// group languages, such as Pug -&gt; HTML; SCSS -&gt; CSS</span>
<span class="w">					</span><span class="nx">group</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">GetLanguageGroup</span><span class="p">(</span><span class="nx">language</span><span class="p">)</span>
<span class="w">					</span><span class="k">if</span><span class="w"> </span><span class="nb">len</span><span class="p">(</span><span class="nx">group</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="p">{</span>
<span class="w">						</span><span class="nx">language</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">group</span>
<span class="w">					</span><span class="p">}</span>

<span class="w">					</span><span class="nx">sizes</span><span class="p">[</span><span class="nx">language</span><span class="p">]</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Size</span>

<span class="w">					</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">				</span><span class="p">}</span>
<span class="w">			</span><span class="p">}</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">(!</span><span class="nx">notVendored</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">analyze</span><span class="p">.</span><span class="nx">IsVendor</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">))</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">IsDotFile</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">)</span><span class="w"> </span><span class="o">||</span>
<span class="w">			</span><span class="nx">enry</span><span class="p">.</span><span class="nx">IsDocumentation</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">)</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">IsConfiguration</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="c1">// If content can not be read or file is too big just do detection by filename</span>
<span class="w">		</span><span class="kd">var</span><span class="w"> </span><span class="nx">content</span><span class="w"> </span><span class="p">[]</span><span class="kt">byte</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Size</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="nx">bigFileSize</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="nx">content</span><span class="p">,</span><span class="w"> </span><span class="nx">_</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">readFile</span><span class="p">(</span><span class="nx">f</span><span class="p">,</span><span class="w"> </span><span class="nx">fileSizeLimit</span><span class="p">)</span>
<span class="w">		</span><span class="p">}</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="p">!</span><span class="nx">notGenerated</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">IsGenerated</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">,</span><span class="w"> </span><span class="nx">content</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="c1">// TODO: Use .gitattributes file for linguist overrides</span>

<span class="w">		</span><span class="nx">language</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">analyze</span><span class="p">.</span><span class="nx">GetCodeLanguage</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">Name</span><span class="p">,</span><span class="w"> </span><span class="nx">content</span><span class="p">)</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">language</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">OtherLanguage</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nx">language</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="c1">// group languages, such as Pug -&gt; HTML; SCSS -&gt; CSS</span>
<span class="w">		</span><span class="nx">group</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">GetLanguageGroup</span><span class="p">(</span><span class="nx">language</span><span class="p">)</span>
<span class="w">		</span><span class="k">if</span><span class="w"> </span><span class="nx">group</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="nx">language</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">group</span>
<span class="w">		</span><span class="p">}</span>

<span class="w">		</span><span class="nx">sizes</span><span class="p">[</span><span class="nx">language</span><span class="p">]</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Size</span>

<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span>
<span class="w">	</span><span class="p">})</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="c1">// filter special languages unless they are the only language</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nb">len</span><span class="p">(</span><span class="nx">sizes</span><span class="p">)</span><span class="w"> </span><span class="p">&gt;</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">for</span><span class="w"> </span><span class="nx">language</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="nx">sizes</span><span class="w"> </span><span class="p">{</span>
<span class="w">			</span><span class="nx">langtype</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">GetLanguageType</span><span class="p">(</span><span class="nx">language</span><span class="p">)</span>
<span class="w">			</span><span class="k">if</span><span class="w"> </span><span class="nx">langtype</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">Programming</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">langtype</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nx">enry</span><span class="p">.</span><span class="nx">Markup</span><span class="w"> </span><span class="p">{</span>
<span class="w">				</span><span class="nb">delete</span><span class="p">(</span><span class="nx">sizes</span><span class="p">,</span><span class="w"> </span><span class="nx">language</span><span class="p">)</span>
<span class="w">			</span><span class="p">}</span>
<span class="w">		</span><span class="p">}</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="nx">sizes</span><span class="p">,</span><span class="w"> </span><span class="kc">nil</span>
<span class="p">}</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">readFile</span><span class="p">(</span><span class="nx">f</span><span class="w"> </span><span class="o">*</span><span class="nx">object</span><span class="p">.</span><span class="nx">File</span><span class="p">,</span><span class="w"> </span><span class="nx">limit</span><span class="w"> </span><span class="kt">int64</span><span class="p">)</span><span class="w"> </span><span class="p">([]</span><span class="kt">byte</span><span class="p">,</span><span class="w"> </span><span class="kt">error</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">	</span><span class="nx">r</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Reader</span><span class="p">()</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="kc">nil</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="k">defer</span><span class="w"> </span><span class="nx">r</span><span class="p">.</span><span class="nx">Close</span><span class="p">()</span>

<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">limit</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="k">return</span><span class="w"> </span><span class="nx">ioutil</span><span class="p">.</span><span class="nx">ReadAll</span><span class="p">(</span><span class="nx">r</span><span class="p">)</span>
<span class="w">	</span><span class="p">}</span>

<span class="w">	</span><span class="nx">size</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">f</span><span class="p">.</span><span class="nx">Size</span>
<span class="w">	</span><span class="k">if</span><span class="w"> </span><span class="nx">limit</span><span class="w"> </span><span class="p">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">size</span><span class="w"> </span><span class="p">&gt;</span><span class="w"> </span><span class="nx">limit</span><span class="w"> </span><span class="p">{</span>
<span class="w">		</span><span class="nx">size</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">limit</span>
<span class="w">	</span><span class="p">}</span>
<span class="w">	</span><span class="nx">buf</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">bytes</span><span class="p">.</span><span class="nx">NewBuffer</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span>
<span class="w">	</span><span class="nx">buf</span><span class="p">.</span><span class="nx">Grow</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="nx">size</span><span class="p">))</span>
<span class="w">	</span><span class="nx">_</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">io</span><span class="p">.</span><span class="nx">Copy</span><span class="p">(</span><span class="nx">buf</span><span class="p">,</span><span class="w"> </span><span class="nx">io</span><span class="p">.</span><span class="nx">LimitReader</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span><span class="w"> </span><span class="nx">limit</span><span class="p">))</span>
<span class="w">	</span><span class="k">return</span><span class="w"> </span><span class="nx">buf</span><span class="p">.</span><span class="nx">Bytes</span><span class="p">(),</span><span class="w"> </span><span class="nx">err</span>
<span class="p">}</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.39.1</a>) at 2025-01-21 14:11:08 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>