{"title":"Submitting contributions","version":"5.1","locale":"pt-br","docname":"internals/contributing/writing-code/submitting-patches","url":"/pt-br/5.1/internals/contributing/writing-code/submitting-patches/","canonical":"https://djangodocs.dev/pt-br/5.1/internals/contributing/writing-code/submitting-patches/","summary":"We’re always grateful for contributions to Django’s code. Indeed, bug reports with associated contributions will get fixed far more quickly than those without a…","html":"<h1>Submitting contributions<a class=\"heading-anchor\" href=\"#submitting-contributions\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>We’re always grateful for contributions to Django’s code. Indeed, bug reports\nwith associated contributions will get fixed <em>far</em> more quickly than those\nwithout a solution.</p>\n<section id=\"typo-fixes-and-trivial-documentation-changes\">\n<h2>Correções de ortografia e mudanças triviais na documentação<a class=\"heading-anchor\" href=\"#typo-fixes-and-trivial-documentation-changes\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Se você está corrigindo um problema realmente trivial, por exemplo, mudando uma palavra na documentação, a melhor maneira de providenciar o patch é usando um pull request sem um ticket no Trac associado.</p>\n<p>Veja a <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/working-with-git/\"><span class=\"doc\">Trabalhando com Git e GitHub</span></a> para mais detalhes sobre como usar os pull requests.</p>\n</section>\n<section id=\"claiming-tickets\">\n<h2>“Reinvindicando” tickets<a class=\"heading-anchor\" href=\"#claiming-tickets\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Em um projeto open-source com voluntários espalhados por todo o mundo, é importante gerenciar a comunicação de forma eficiente de modo que o trabalho não seja duplicado e voluntários possam ser o mais eficiente quanto possível.</p>\n<p>Por tanto, nossa política é que os voluntários “reinvindiquem” os tickets de modo a permitir que os desenvolvedores do projeto saibam que aquele bug em específico ou funcionalidade está sendo atendida.</p>\n<p>Se você identificou uma contribuição que você gostaria de fazer e se você é capaz de fazer essa correção (capacidade aqui mensurada pelas suas abilidades para programar, conhecimento de como o Django funciona internamente e tempo disponível), reinvindique ele seguindo os passos abaixo:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference external\" href=\"https://www.djangoproject.com/accounts/register/\">Faça login usando a sua conta no GitHub</a> ou <a class=\"reference external\" href=\"https://code.djangoproject.com/github/login\">criando uma conta</a> no nosso sistema de tickets. Se você tem uma conta mas esqueceu sua senha, você pode resetá-la usando a <a class=\"reference external\" href=\"https://www.djangoproject.com/accounts/password/reset/\">página de recuperação de senha</a>.</p></li>\n<li><p>Se um ticket para um problema não foi criado ainda, crie um no nosso <a class=\"reference external\" href=\"https://code.djangoproject.com/\">rastreador de tickets</a>.</p></li>\n<li><p>Se o ticket para esse problema já existe, certifique-se de que ninguém mais o reinvindicou. Para fazer isso, procure na seção “Owned by” do ticket. Se ele estiver atribuído para “nobody”, então ele está disponível para reinvindicação. Caso contrário, outra pessoa já pode estar trabalhando nesse ticket. Busque outro bug/funcionalidade para trabalhar em cima ou contate o desenvolvedor trabalhando nesse ticket para oferecer a sua ajuda. Se o ticket já foi atribuído por semanas ou meses sem qualquer atividade, provavelmente é seguro reatribuí-lo para você.</p></li>\n<li><p>Log into your account, if you haven’t already, by clicking “GitHub Login”\nor “DjangoProject Login” in the upper left of the ticket page. Once logged\nin, you can then click the “Modify Ticket” button near the bottom of the\npage.</p></li>\n<li><p>Claim the ticket by clicking the “assign to” radio button in the “Action”\nsection. Your username will be filled in the text box by default.</p></li>\n<li><p>Finally click the “Submit changes” button at the bottom to save.</p></li>\n</ul>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The Django software foundation requests that anyone contributing more than\na trivial change to Django sign and submit a <a class=\"reference external\" href=\"https://www.djangoproject.com/foundation/cla/\">Contributor License\nAgreement</a>, this ensures that the Django Software Foundation has clear\nlicense to all contributions allowing for a clear license for all users.</p>\n</aside>\n<section id=\"ticket-claimers-responsibility\">\n<h3>Responsabilidade de quem reinvindicou um Ticket<a class=\"heading-anchor\" href=\"#ticket-claimers-responsibility\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Quando você reinvindicar um ticket, você terá a responsabilidade de trabalhar nele em uma quantidade de tempo razoável. Se você não tem tempo para trabalhar nele, ou abra mão dele ou nem se quer faça a reinvindicação do ticket em primeiro lugar!</p>\n<p>Se não existir sinal de progresso em um ticket reinvindicado em particular por uma semana ou duas, outros desenvolvedores podem pedir para você abrir mão da reinvindicação do ticket de modo que ele não esteja mais monopolizado e alguém mais possa reinvindicá-lo novamente.</p>\n<p>Se você reinvindicou um ticket e está demorando um bom tempo (dias ou semanas) para programar, mantenha todo mundo atualizado postando comentários no ticket. Se você não fornecer atualizações regulares, e você não responder a um pedido por relatório de progresso, a sua reinvindicação ao ticket poderá ser revogada.</p>\n<p>Como sempre, mais comunicação é melhor do que menos comunicação.</p>\n</section>\n<section id=\"which-tickets-should-be-claimed\">\n<h3>Quais tickets devem ser reinvindicados?<a class=\"heading-anchor\" href=\"#which-tickets-should-be-claimed\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Going through the steps of claiming tickets is overkill in some cases.</p>\n<p>In the case of small changes, such as typos in the documentation or small bugs\nthat will only take a few minutes to fix, you don’t need to jump through the\nhoops of claiming tickets. Submit your changes directly and you’re done!</p>\n<p>It is <em>always</em> acceptable, regardless whether someone has claimed it or not, to\nlink proposals to a ticket if you happen to have the changes ready.</p>\n</section>\n</section>\n<section id=\"contribution-style\">\n<span id=\"patch-style\"></span><h2>Contribution style<a class=\"heading-anchor\" href=\"#contribution-style\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Certifique-se de que qualquer contribuição que você fizer preencha pelo menos os requisitos abaixo:</p>\n<ul class=\"simple\">\n<li><p>The code required to fix a problem or add a feature is an essential part\nof a solution, but it is not the only part. A good fix should also include a\n<a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/unit-tests/\"><span class=\"doc\">regression test</span></a> to validate the behavior that has been\nfixed and to prevent the problem from arising again. Also, if some tickets\nare relevant to the code that you’ve written, mention the ticket numbers in\nsome comments in the test so that one can easily trace back the relevant\ndiscussions after your patch gets committed, and the tickets get closed.</p></li>\n<li><p>If the code adds a new feature, or modifies the behavior of an existing\nfeature, the change should also contain documentation.</p></li>\n</ul>\n<p>When you think your work is ready to be reviewed, send <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/working-with-git/\"><span class=\"doc\">a GitHub pull\nrequest</span></a>.\nIf you can’t send a pull request for some reason, you can also use patches in\nTrac. When using this style, follow these guidelines.</p>\n<ul class=\"simple\">\n<li><p>Envie os patches dentro do formato retornado por um comando <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">diff</span></code>.</p></li>\n<li><p>keAnexe os patches a um ticket dentro do  <a class=\"reference external\" href=\"https://code.djangoproject.com/\">ticket tracker</a>, usando o botão “attach file”. Por favor <em>não</em> coloque o patch na descrição do ticket ou dentro de um comentário a não ser que seja um patch de uma linha.</p></li>\n<li><p>Nomeie o arquivo de patch com a extensão <code class=\"docutils literal notranslate\"><span class=\"pre\">.diff</span></code>; isso permitirá que o rastreador de tickets aplique o estilo de formatação de sintaxe correto, o que ajuda muito.</p></li>\n</ul>\n<p>Independentemente da maneira pela qual você irá enviar o seu trabalho, siga os passos a seguir:</p>\n<ul class=\"simple\">\n<li><p>Make sure your code fulfills the requirements in our <a class=\"reference internal\" href=\"#patch-review-checklist\"><span class=\"std std-ref\">contribution\nchecklist</span></a>.</p></li>\n<li><p>Marque a caixa “Has patch” no ticket e certifique-se de que as caixas “Needs documentation”, “Needs tests”, and “Patch needs improvement” não estão marcadas. Isso fará com que o ticket seja exibido na pilha “Patches needing review” na  <a class=\"reference external\" href=\"https://dashboard.djangoproject.com/\">Development dashboard</a>.</p></li>\n</ul>\n</section>\n<section id=\"contributions-which-require-community-feedback\">\n<h2>Contributions which require community feedback<a class=\"heading-anchor\" href=\"#contributions-which-require-community-feedback\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>A wider community discussion is required when a patch introduces new Django\nfunctionality and makes some sort of design decision. This is especially\nimportant if the approach involves a <a class=\"reference internal\" href=\"#deprecating-a-feature\"><span class=\"std std-ref\">deprecation</span></a>\nor introduces breaking changes.</p>\n<p>The following are different approaches for gaining feedback from the community.</p>\n<section id=\"the-django-forum\">\n<h3>The Django Forum<a class=\"heading-anchor\" href=\"#the-django-forum\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>You can propose a change on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a>. You should explain the need\nfor the change, go into details of the approach and discuss alternatives.</p>\n<p>Please include a link to such discussions in your contributions.</p>\n</section>\n<section id=\"third-party-package\">\n<h3>Third party package<a class=\"heading-anchor\" href=\"#third-party-package\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django does not accept experimental features. All features must follow our\n<a class=\"reference internal\" href=\"/pt-br/5.1/internals/release-process/#internal-release-deprecation-policy\"><span class=\"std std-ref\">deprecation policy</span></a>. Hence, it can\ntake months or years for Django to iterate on an API design.</p>\n<p>If you need user feedback on a public interface, it is better to create a\nthird-party package first. You can iterate on the public API much faster, while\nalso validating the need for the feature.</p>\n<p>Once this package becomes stable and there are clear benefits of incorporating\naspects into Django core, starting a discussion on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> would be\nthe next step.</p>\n</section>\n<section id=\"django-enhancement-proposal-dep\">\n<h3>Django Enhancement Proposal (DEP)<a class=\"heading-anchor\" href=\"#django-enhancement-proposal-dep\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Similar to Python’s PEPs, Django has <a class=\"reference external\" href=\"https://github.com/django/deps\">Django Enhancement Proposals</a> or DEPs. A\nDEP is a design document which provides information to the Django community, or\ndescribes a new feature or process for Django. They provide concise technical\nspecifications of features, along with rationales. DEPs are also the primary\nmechanism for proposing and collecting community input on major new features.</p>\n<p>Before considering writing a DEP, it is recommended to first open a discussion\non the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a>. This allows the community to provide feedback and helps\nrefine the proposal. Once the DEP is ready the <a class=\"reference internal\" href=\"/pt-br/5.1/internals/organization/#steering-council\"><span class=\"std std-ref\">Steering Council</span></a> votes on whether to accept it.</p>\n<p>Some examples of DEPs that have been approved and fully implemented:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference external\" href=\"https://github.com/django/deps/blob/main/final/0181-orm-expressions.rst\">DEP 181: ORM Expressions</a></p></li>\n<li><p><a class=\"reference external\" href=\"https://github.com/django/deps/blob/main/final/0182-multiple-template-engines.rst\">DEP 182: Multiple Template Engines</a></p></li>\n<li><p><a class=\"reference external\" href=\"https://github.com/django/deps/blob/main/final/0201-simplified-routing-syntax.rst\">DEP 201: Simplified routing syntax</a></p></li>\n</ul>\n</section>\n</section>\n<section id=\"deprecating-a-feature\">\n<span id=\"id1\"></span><h2>Depreciando uma funcionalidade<a class=\"heading-anchor\" href=\"#deprecating-a-feature\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>There are a couple of reasons that code in Django might be deprecated:</p>\n<ul class=\"simple\">\n<li><p>Se a funcionalidade foi melhorada ou modificada de modo a não ser mais compatível com versões anteriores, a antiga funcionalidade ou comportamento pode ser depreciada.</p></li>\n<li><p>Algumas vezes o Django inclui um backport de uma biblioteca Python que não está incluída na versão do Python suportada atualmente pelo Django. Quando o Django não precisa mais dar suporte a versão antiga do Python que não fornece a biblioteca, essa biblioteca será depreciada no Django.</p></li>\n</ul>\n<p>As the <a class=\"reference internal\" href=\"/pt-br/5.1/internals/release-process/#internal-release-deprecation-policy\"><span class=\"std std-ref\">deprecation policy</span></a> describes,\nthe first release of Django that deprecates a feature (<code class=\"docutils literal notranslate\"><span class=\"pre\">A.B</span></code>) should raise a\n<code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code> (where XX is the Django version where the feature\nwill be removed) when the deprecated feature is invoked. Assuming we have good\ntest coverage, these warnings are converted to errors when <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/unit-tests/#running-unit-tests\"><span class=\"std std-ref\">running the\ntest suite</span></a> with warnings enabled:\n<code class=\"docutils literal notranslate\"><span class=\"pre\">python</span> <span class=\"pre\">-Wa</span> <span class=\"pre\">runtests.py</span></code>. Thus, when adding a <code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code>\nyou need to eliminate or silence any warnings generated when running the tests.</p>\n<p>O primeiro passo é remover qualquer uso do comportamento depreciado no próprio Django. Depois você pode silenciar os warnings nos testes que testam o comportamento depreciado usando o decorator <code class=\"docutils literal notranslate\"><span class=\"pre\">ignore_warnings</span></code>, na classe ou diretamente nos testes:</p>\n<ol class=\"arabic\">\n<li><p>Em um teste em particular:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.test</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">ignore_warnings</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n\n<span class=\"nd\">@ignore_warnings</span><span class=\"p\">(</span><span class=\"n\">category</span><span class=\"o\">=</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">)</span>\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">test_foo</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span> <span class=\"o\">...</span>\n</code></pre></div>\n</li>\n<li><p>Para um caso de teste inteiro:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.test</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">ignore_warnings</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n\n<span class=\"nd\">@ignore_warnings</span><span class=\"p\">(</span><span class=\"n\">category</span><span class=\"o\">=</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">)</span>\n<span class=\"k\">class</span><span class=\"w\"> </span><span class=\"nc\">MyDeprecatedTests</span><span class=\"p\">(</span><span class=\"n\">unittest</span><span class=\"o\">.</span><span class=\"n\">TestCase</span><span class=\"p\">):</span> <span class=\"o\">...</span>\n</code></pre></div>\n</li>\n</ol>\n<p>You should also add a test for the deprecation warning:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">test_foo_deprecation_warning</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n    <span class=\"n\">msg</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;Expected deprecation message&quot;</span>\n    <span class=\"k\">with</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">assertWarnsMessage</span><span class=\"p\">(</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">,</span> <span class=\"n\">msg</span><span class=\"p\">)</span> <span class=\"k\">as</span> <span class=\"n\">ctx</span><span class=\"p\">:</span>\n        <span class=\"c1\"># invoke deprecated behavior</span>\n        <span class=\"o\">...</span>\n    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">assertEqual</span><span class=\"p\">(</span><span class=\"n\">ctx</span><span class=\"o\">.</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"vm\">__file__</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>It’s important to include a <code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code> comment above code\nwhich has no warning reference, but will need to be changed or removed when the\ndeprecation ends. This could include hooks which have been added to keep the\nprevious behavior, or standalone items that are unnecessary or unused when the\ndeprecation ends. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">import</span><span class=\"w\"> </span><span class=\"nn\">warnings</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.utils.deprecation</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">RemovedInDjangoXXWarning</span>\n\n\n<span class=\"c1\"># RemovedInDjangoXXWarning.</span>\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">old_private_helper</span><span class=\"p\">():</span>\n    <span class=\"c1\"># Helper function that is only used in foo().</span>\n    <span class=\"k\">pass</span>\n\n\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">foo</span><span class=\"p\">():</span>\n    <span class=\"n\">warnings</span><span class=\"o\">.</span><span class=\"n\">warn</span><span class=\"p\">(</span>\n        <span class=\"s2\">&quot;foo() is deprecated.&quot;</span><span class=\"p\">,</span>\n        <span class=\"n\">category</span><span class=\"o\">=</span><span class=\"n\">RemovedInDjangoXXWarning</span><span class=\"p\">,</span>\n        <span class=\"n\">stacklevel</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span>\n    <span class=\"p\">)</span>\n    <span class=\"n\">old_private_helper</span><span class=\"p\">()</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>Finalmente, existem algumas atualizações na documentação do Django para fazer:</p>\n<ol class=\"arabic simple\">\n<li><p>Se a funcionalidade existente está documentada, marque ela como depreciada na documentação usando a anotação <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">deprecated::</span> <span class=\"pre\">A.B</span></code>. Inclua uma curta descrição e uma nota sobre o caminho para atualizar se possível.</p></li>\n<li><p>Adicione uma descrição de comportamento depreciado, e o caminho de atualização se possível, para as notas da release atual (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>) abaixo do header “Features deprecated in A.B”.</p></li>\n<li><p>Adicione uma nova entrada na linha do tempo de depreciação (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/internals/deprecation.txt</span></code>) abaixo da versão apropriada descrevendo qual código será removido.</p></li>\n</ol>\n<p>Once you have completed these steps, you are finished with the deprecation.\nIn each <a class=\"reference internal\" href=\"/pt-br/5.1/internals/release-process/#term-Feature-release\"><span class=\"xref std std-term\">feature release</span></a>, all\n<code class=\"docutils literal notranslate\"><span class=\"pre\">RemovedInDjangoXXWarning</span></code>s matching the new version are removed.</p>\n</section>\n<section id=\"javascript-contributions\">\n<h2>JavaScript contributions<a class=\"heading-anchor\" href=\"#javascript-contributions\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>For information on JavaScript contributions, see the <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/javascript/#javascript-patches\"><span class=\"std std-ref\">Patches JavaScript</span></a>\ndocumentation.</p>\n</section>\n<section id=\"optimization-patches\">\n<h2>Optimization patches<a class=\"heading-anchor\" href=\"#optimization-patches\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Patches aiming to deliver a performance improvement should provide benchmarks\nshowing the before and after impact of the patch and sharing the commands for\nreviewers to reproduce.</p>\n<section id=\"django-asv-benchmarks\">\n<span id=\"id2\"></span><h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django-asv</span></code> benchmarks<a class=\"heading-anchor\" href=\"#django-asv-benchmarks\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><a class=\"reference external\" href=\"https://github.com/django/django-asv/\">django-asv</a> monitors the performance of Django code over time. These\nbenchmarks can be run on a pull request by labeling the pull request with\n<code class=\"docutils literal notranslate\"><span class=\"pre\">benchmark</span></code>. Adding to these benchmarks is highly encouraged.</p>\n</section>\n</section>\n<section id=\"contribution-checklist\">\n<span id=\"patch-review-checklist\"></span><h2>Contribution checklist<a class=\"heading-anchor\" href=\"#contribution-checklist\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Use this checklist to review a pull request. If you are reviewing a pull\nrequest that is not your own and it passes all the criteria below, please set\nthe “Triage Stage” on the corresponding Trac ticket to “Ready for checkin”.\nIf you’ve left comments for improvement on the pull request, please tick the\nappropriate flags on the Trac ticket based on the results of your review:\n“Patch needs improvement”, “Needs documentation”, and/or “Needs tests”. As time\nand interest permits, mergers do final reviews of “Ready for checkin” tickets\nand will either commit the changes or bump it back to “Accepted” if further\nwork needs to be done. If you’re looking to become a merger, doing thorough\nreviews of contributions is a great way to earn trust.</p>\n<p>Looking for a patch to review? Check out the “Patches needing review” section\nof the <a class=\"reference external\" href=\"https://dashboard.djangoproject.com/\">Django Development Dashboard</a>.</p>\n<p>Looking to get your pull request reviewed? Ensure the Trac flags on the ticket\nare set so that the ticket appears in that queue.</p>\n<section id=\"documentation\">\n<h3>Documentação<a class=\"heading-anchor\" href=\"#documentation\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>A documentação é gerada sem erros (<code class=\"docutils literal notranslate\"><span class=\"pre\">make</span> <span class=\"pre\">html</span></code>, ou <code class=\"docutils literal notranslate\"><span class=\"pre\">make.bat</span> <span class=\"pre\">html</span></code> no Windows, do diretório <code class=\"docutils literal notranslate\"><span class=\"pre\">docs</span></code>)?</p></li>\n<li><p>A documentação segue as regras de estilo e escrita em <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-documentation/\"><span class=\"doc\">Escrevendo a documentação</span></a>?</p></li>\n<li><p>Existem quaisquer <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-documentation/#documentation-spelling-check\"><span class=\"std std-ref\">erros de ortografia</span></a>?</p></li>\n</ul>\n</section>\n<section id=\"bugs\">\n<h3>Bugs<a class=\"heading-anchor\" href=\"#bugs\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Existe um teste de regressão apropriado (o teste deve falhar antes da correção ser aplicada)?</p></li>\n<li><p>If it’s a bug that <a class=\"reference internal\" href=\"/pt-br/5.1/internals/release-process/#supported-versions-policy\"><span class=\"std std-ref\">qualifies for a backport</span></a>\nto the stable version of Django, is there a release note in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.C.txt</span></code>? Bug fixes that will be applied only to the main\nbranch don’t need a release note.</p></li>\n</ul>\n</section>\n<section id=\"new-features\">\n<h3>Novas funcionalidades<a class=\"heading-anchor\" href=\"#new-features\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Existem testes para “exercitar” todo o código recém-criado?</p></li>\n<li><p>Existe uma nota de release em <code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>?</p></li>\n<li><p>Existe documentação para a funcionalidade e ela está <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-documentation/#documenting-new-features\"><span class=\"std std-ref\">anotada de modo apropriado</span></a> com <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionadded::</span> <span class=\"pre\">A.B</span></code> ou <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionchanged::</span> <span class=\"pre\">A.B</span></code>?</p></li>\n</ul>\n</section>\n<section id=\"id3\">\n<h3>Depreciando uma funcionalidade<a class=\"heading-anchor\" href=\"#id3\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Veja o guia <span class=\"xref std std-ref\">depreciando uma funcionalidade</span>.</p>\n</section>\n<section id=\"all-code-changes\">\n<h3>Todo código muda<a class=\"heading-anchor\" href=\"#all-code-changes\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Does the <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/coding-style/\"><span class=\"doc\">coding style</span></a> conform to our\nguidelines? Are there any  <code class=\"docutils literal notranslate\"><span class=\"pre\">black</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">blacken-docs</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">flake8</span></code>,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">isort</span></code>, or <code class=\"docutils literal notranslate\"><span class=\"pre\">zizmor</span></code> errors? You can install the <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/writing-code/coding-style/#coding-style-pre-commit\"><span class=\"std std-ref\">pre-commit</span></a> hooks to automatically catch these errors.</p></li>\n<li><p>Se a mudança não é compatível com versões anteriores de modo algum, existe um aviso nas notas de release (<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/A.B.txt</span></code>)?</p></li>\n<li><p>Is Django’s test suite passing?</p></li>\n</ul>\n</section>\n<section id=\"all-tickets\">\n<h3>Todos os tickets<a class=\"heading-anchor\" href=\"#all-tickets\"><span class=\"visually-hidden\">Link para este cabeçalho</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>O pull request é um commit único esmagado com uma mensagem que segue o nosso  <a class=\"reference internal\" href=\"/pt-br/5.1/internals/contributing/committing-code/#committing-guidelines\"><span class=\"std std-ref\">formato de mensagens de commit</span></a>?</p></li>\n<li><p>Are you the patch author and a new contributor? Please add yourself to the\n<a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/5.1.x/AUTHORS\">AUTHORS</a> file and submit a <a class=\"reference external\" href=\"https://www.djangoproject.com/foundation/cla/\">Contributor License Agreement</a>.</p></li>\n</ul>\n</section>\n</section>","rootId":"submitting-contributions","toc":[{"title":"Correções de ortografia e mudanças triviais na documentação","anchor":"typo-fixes-and-trivial-documentation-changes","children":[]},{"title":"“Reinvindicando” tickets","anchor":"claiming-tickets","children":[{"title":"Responsabilidade de quem reinvindicou um Ticket","anchor":"ticket-claimers-responsibility","children":[]},{"title":"Quais tickets devem ser reinvindicados?","anchor":"which-tickets-should-be-claimed","children":[]}]},{"title":"Contribution style","anchor":"contribution-style","children":[]},{"title":"Contributions which require community feedback","anchor":"contributions-which-require-community-feedback","children":[{"title":"The Django Forum","anchor":"the-django-forum","children":[]},{"title":"Third party package","anchor":"third-party-package","children":[]},{"title":"Django Enhancement Proposal (DEP)","anchor":"django-enhancement-proposal-dep","children":[]}]},{"title":"Depreciando uma funcionalidade","anchor":"deprecating-a-feature","children":[]},{"title":"JavaScript contributions","anchor":"javascript-contributions","children":[]},{"title":"Optimization patches","anchor":"optimization-patches","children":[{"title":"django-asv benchmarks","anchor":"django-asv-benchmarks","children":[]}]},{"title":"Contribution checklist","anchor":"contribution-checklist","children":[{"title":"Documentação","anchor":"documentation","children":[]},{"title":"Bugs","anchor":"bugs","children":[]},{"title":"Novas funcionalidades","anchor":"new-features","children":[]},{"title":"Depreciando uma funcionalidade","anchor":"id3","children":[]},{"title":"Todo código muda","anchor":"all-code-changes","children":[]},{"title":"Todos os tickets","anchor":"all-tickets","children":[]}]}],"breadcrumbs":[{"docname":"internals/index","title":"Funcionamento interno do Projeto Django","url":"/pt-br/5.1/internals/"},{"docname":"internals/contributing/index","title":"Contribuindo com o Django","url":"/pt-br/5.1/internals/contributing/"},{"docname":"internals/contributing/writing-code/index","title":"Contributing code","url":"/pt-br/5.1/internals/contributing/writing-code/"}],"prev":{"docname":"internals/contributing/writing-code/index","title":"Contributing code","url":"/pt-br/5.1/internals/contributing/writing-code/"},"next":{"docname":"internals/contributing/writing-code/unit-tests","title":"Testes unitários","url":"/pt-br/5.1/internals/contributing/writing-code/unit-tests/"},"formats":{"html":"/pt-br/5.1/internals/contributing/writing-code/submitting-patches/","markdown":"/pt-br/5.1/internals/contributing/writing-code/submitting-patches.md","json":"/pt-br/5.1/internals/contributing/writing-code/submitting-patches.json"},"source":"https://github.com/django/django/blob/stable/5.1.x/docs/internals/contributing/writing-code/submitting-patches.txt","official":"https://docs.djangoproject.com/pt-br/5.1/internals/contributing/writing-code/submitting-patches/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}