<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anibal</title>
    <description>The latest articles on DEV Community by Anibal (@anibalardid).</description>
    <link>https://dev.to/anibalardid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F245588%2F38805317-995f-4325-9346-7904bcd65eb0.jpeg</url>
      <title>DEV Community: Anibal</title>
      <link>https://dev.to/anibalardid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anibalardid"/>
    <language>en</language>
    <item>
      <title>How to check commit message and branch name with git hooks without any new installation</title>
      <dc:creator>Anibal</dc:creator>
      <pubDate>Wed, 29 Dec 2021 18:25:40 +0000</pubDate>
      <link>https://dev.to/anibalardid/how-to-check-commit-message-and-branch-name-with-git-hooks-without-any-new-installation-n34</link>
      <guid>https://dev.to/anibalardid/how-to-check-commit-message-and-branch-name-with-git-hooks-without-any-new-installation-n34</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hi All ! &lt;br&gt;
I'm a tech lead, and I'm on charge to check Pull Request/Merge Request on my team. And also to create release notes (CHANGELOG.md) on each release.&lt;br&gt;
So, my first problem was to resolve the commits of the developers, that they always have some mistake, or have errors into the commit message (without correct format), or errors in the branch name.&lt;br&gt;
I searched and I found different solutions. A lot of them need to use an external software, like node (npm library), or php composer library, etc. And the projects are in different technologies, like Android, PHP, .NET, etc.&lt;/p&gt;

&lt;p&gt;After checking all that I found, I created a solution that works in all environments without external dependencies.&lt;/p&gt;

&lt;p&gt;The solution is really easy.&lt;br&gt;
You need to follow these easy steps&lt;/p&gt;
&lt;h2&gt;
  
  
  Steps:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;create &lt;strong&gt;.git-hooks&lt;/strong&gt; folder into your project root directory, at the same level you already have .git folder&lt;/li&gt;
&lt;li&gt;create 2 files into this folder: &lt;strong&gt;pre-commit&lt;/strong&gt; and &lt;strong&gt;prepare-commit-msg&lt;/strong&gt; (these two files don't have an extension)&lt;/li&gt;
&lt;li&gt;put the correct code into each file (I will add them below these steps)&lt;/li&gt;
&lt;li&gt;run this command in your command line, into your main folder of your project (one level up from .git-hooks): &lt;strong&gt;git config core.hooksPath .git-hooks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;READY ! &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  The Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;pre-commit&lt;/strong&gt; file code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nv"&gt;BRANCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-parse &lt;span class="nt"&gt;--abbrev-ref&lt;/span&gt; HEAD&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;REGEX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"^(dev|release)-([0-9]+)-q([0-9]+)&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;([0-9]+)&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;(.+)$"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$BRANCH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="nv"&gt;$REGEX&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Your commit was rejected due to branching name"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please rename your branch with '(dev|release)-YYYY-qX.X.X' syntax"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;prepare-commit-msg&lt;/strong&gt; file code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nv"&gt;MESSAGE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; 
&lt;span class="nv"&gt;COMMITFORMAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"^(feat|fix|docs|style|refactor|test|chore|perf|other)(&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;(.*)&lt;/span&gt;&lt;span class="se"&gt;\)&lt;/span&gt;&lt;span class="s2"&gt;)?: #([0-9]+) (.*)$"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MESSAGE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="nv"&gt;$COMMITFORMAT&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Your commit was rejected due to the commit message. Skipping..."&lt;/span&gt; 
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please use the following format:"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"feat: #1234 feature example comment"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"fix(ui): #4321 bugfix example comment"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"More details on COMMITS.md"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can edit it according to your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;File &lt;strong&gt;pre-commit&lt;/strong&gt;: check branch names.&lt;br&gt;
In my case I filter to use only format like that:&lt;br&gt;
dev-YYYY-qX.X.X&lt;br&gt;
release-YYYY-qX.X.X&lt;br&gt;
Where YYYY is the year, and X.X.X is the version, in our case we use the Quarter number.&lt;br&gt;
You could change that using regex and put what you want ;)&lt;/p&gt;

&lt;p&gt;File &lt;strong&gt;prepare-commit-msg&lt;/strong&gt;: check commit message.&lt;br&gt;
In our case, we use the following format:&lt;br&gt;
&lt;a href="https://www.conventionalcommits.org/en/v1.0.0/"&gt;https://www.conventionalcommits.org/en/v1.0.0/&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="http://karma-runner.github.io/1.0/dev/git-commit-msg.html"&gt;http://karma-runner.github.io/1.0/dev/git-commit-msg.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Off course, you could change it as your needs.&lt;/p&gt;

&lt;p&gt;And finally, the command &lt;strong&gt;git config core.hooksPath .git-hooks&lt;/strong&gt; change your local git hooks configuration to use the new path .&lt;/p&gt;

</description>
      <category>git</category>
      <category>hooks</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>My Developer Setup</title>
      <dc:creator>Anibal</dc:creator>
      <pubDate>Wed, 26 Feb 2020 16:50:07 +0000</pubDate>
      <link>https://dev.to/anibalardid/my-developer-setup-2p6p</link>
      <guid>https://dev.to/anibalardid/my-developer-setup-2p6p</guid>
      <description>&lt;p&gt;Hi all ! &lt;br&gt;
Finally I could upload my desktop setup and explain what things I have/use every day as Developer.&lt;br&gt;
I work in company as Frontend Developer (Angular and AngularJS) , and as freelancer in my free time as fullstack (PHP, JS, etc)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvmyyhuev7lkaof0ekxiy.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvmyyhuev7lkaof0ekxiy.JPG" alt="Desktop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa92ottbvjnxu9ks6ifoh.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa92ottbvjnxu9ks6ifoh.JPG" alt="Desktop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;External Display Samsung SyncMaster T260N (vga, old, but it is ok :D )&lt;/li&gt;
&lt;li&gt;Notebook &lt;a href="https://www.asus.com/Laptops/ASUS-TUF-Gaming-FX705DD-DT-DU/" rel="noopener noreferrer"&gt;Asus TUF FX705DT&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Memory: 32 GB Ram&lt;/li&gt;
&lt;li&gt;Processor: AMD® Ryzen™ 7 3750H Processor&lt;/li&gt;
&lt;li&gt;Display: 17.3" (16:9) LED-backlit FHD (1920x1080)&lt;/li&gt;
&lt;li&gt;Graphic: NVIDIA® GeForce® GTX 1650 , with 4GB GDDR5 VRAM&lt;/li&gt;
&lt;li&gt;Storage: 512GB PCIe® Gen3 SSD&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Keyboard and Mouse Logitech&lt;/li&gt;

&lt;li&gt;Speakers 2.1 Genius&lt;/li&gt;

&lt;li&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Software
&lt;/h3&gt;

&lt;p&gt;The software that I use every day as developer in the mostly cases are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GNU/Linux Operating System. Now with Ubuntu 18.04 (sometimes I hop between different distros like Mint, Kubuntu, Fedora, Elementary, Antergos, etc)&lt;/li&gt;
&lt;li&gt;Visual Code Studio&lt;/li&gt;
&lt;li&gt;Sublime&lt;/li&gt;
&lt;li&gt;Slack&lt;/li&gt;
&lt;li&gt;Audacity&lt;/li&gt;
&lt;li&gt;Terminator&lt;/li&gt;
&lt;li&gt;Gisto&lt;/li&gt;
&lt;li&gt;DBeaver&lt;/li&gt;
&lt;li&gt;Filezilla&lt;/li&gt;
&lt;li&gt;Gimp&lt;/li&gt;
&lt;li&gt;Libreoffice&lt;/li&gt;
&lt;li&gt;MySql Workbench&lt;/li&gt;
&lt;li&gt;Meld&lt;/li&gt;
&lt;li&gt;Postman&lt;/li&gt;
&lt;li&gt;Robo3t&lt;/li&gt;
&lt;li&gt;Zoom&lt;/li&gt;
&lt;li&gt;Termius&lt;/li&gt;
&lt;li&gt;SoapUI&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;ZSH&lt;/li&gt;
&lt;li&gt;Chrome&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Chrome Extensions/Apps:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Workona&lt;/li&gt;
&lt;li&gt;ClickUp&lt;/li&gt;
&lt;li&gt;TimenEye&lt;/li&gt;
&lt;li&gt;Bitwarden&lt;/li&gt;
&lt;li&gt;Awesome Screenshot&lt;/li&gt;
&lt;li&gt;AdGuard Adblocker&lt;/li&gt;
&lt;li&gt;The Great Suspender&lt;/li&gt;
&lt;li&gt;Deezer&lt;/li&gt;
&lt;li&gt;Loom&lt;/li&gt;
&lt;li&gt;AdGuard VPN&lt;/li&gt;
&lt;li&gt;JSON Formatter&lt;/li&gt;
&lt;li&gt;WhatRuns&lt;/li&gt;
&lt;li&gt;Unsplash Instant&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And someone else :)&lt;/p&gt;

&lt;p&gt;My post was inspired by :&lt;br&gt;
&lt;a href="https://dev.to/starbist/my-setup-54a6"&gt;https://dev.to/starbist/my-setup-54a6&lt;/a&gt;&lt;/p&gt;

</description>
      <category>workstations</category>
      <category>setup</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to develop WordPress sites no matter where you are</title>
      <dc:creator>Anibal</dc:creator>
      <pubDate>Tue, 08 Oct 2019 20:42:55 +0000</pubDate>
      <link>https://dev.to/anibalardid/how-to-develop-in-wordpress-no-matter-where-you-are-307n</link>
      <guid>https://dev.to/anibalardid/how-to-develop-in-wordpress-no-matter-where-you-are-307n</guid>
      <description>&lt;p&gt;It is my first article, so, sorry if I make mistakes :D&lt;/p&gt;

&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Why I developed it?&lt;/li&gt;
&lt;li&gt;To who is it?&lt;/li&gt;
&lt;li&gt;Features&lt;/li&gt;
&lt;li&gt;Free vs Subscription&lt;/li&gt;
&lt;li&gt;Backlog&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why I developed it? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I am a developer, but sometimes I use different online services.&lt;br&gt;
For example to develop WordPress sites I was used different online platforms. &lt;/p&gt;

&lt;p&gt;Why I used it ? Because I want to develop from my computer or from my work laptop, or whatever I am, without having a local environment and the data into my computer. And also, to pass url to my client without having my computer sharing connection and without using my hostings.&lt;/p&gt;

&lt;p&gt;Why I created DemosWP?&lt;br&gt;
Because some online services went 100% paid services. And I want to have and offer at minimun 1 site free to could develop and test online.&lt;br&gt;
So, after some different steps and stages, I create and put online this platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  To who is this? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This platform is ideal for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;people who are learning&lt;/li&gt;
&lt;li&gt;people who want to try something quickly online without having to install anything&lt;/li&gt;
&lt;li&gt;people who work from different places or computers&lt;/li&gt;
&lt;li&gt;teachers who want to give their students a place to learn without having to have knowledge of installing a local environment or acquiring a hosting&lt;/li&gt;
&lt;li&gt;people who work as a team and want to have a place in common to work at the same time&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Features &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Features that the platform has at this moment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create sites with a few clicks&lt;/li&gt;
&lt;li&gt;Install plugins and themes with the same site creation form&lt;/li&gt;
&lt;li&gt;Import dummy content to have site with fake content and doesn't have it empty (WooCommerce dummy products too)&lt;/li&gt;
&lt;li&gt;FTP and MySQL access&lt;/li&gt;
&lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Free vs Subscription &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;At the beggining the platform was 100% free. But I have a big problem that another services doesn't have. More user require more and more resources (servers disk size, cpu, memory, etc).&lt;br&gt;
And only with sponsors I couldn't cover these expenses, so, I need to add paid subscriptions and limit free accounts (sites amount and features enabled).&lt;/p&gt;

&lt;h3&gt;
  
  
  Backlog &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I want to add more features in the close future.&lt;br&gt;
Like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;clone site with few click&lt;/li&gt;
&lt;li&gt;import sites backups with a few clicks&lt;/li&gt;
&lt;li&gt;migrate site to hosting (using mysql and ftp connection)&lt;/li&gt;
&lt;li&gt;add ssl to all sites&lt;/li&gt;
&lt;li&gt;create blueprints and create new sites using that&lt;/li&gt;
&lt;li&gt;create new sites based on complete templates ready to use&lt;/li&gt;
&lt;li&gt;and more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could use it here:&lt;br&gt;
&lt;a href="https://demoswp.dev"&gt;https://demoswp.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks ! &lt;/p&gt;

</description>
      <category>php</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
