At the lowest level of checking, you can use the Puppet parser to do syntax validation.
There are a couple of places where you can insert syntax validation. One method is by manually running `puppet parser validate` to make sure that the manifest can be parsed before you commit your changes or deploy them to a live environment.
Puppet parser lets you validate Puppet code to make sure it contains no syntax errors. It can be a useful part of your continuous integration toolchain.
For example :
Validate the default site manifest at /etc/puppetlabs/puppet/manifests/site.pp:
$ puppet parser validate
Validate two arbitrary manifest files:
$ puppet parser validate init.pp vhost.pp
For more info: https://puppet.com/docs/puppet/6.7/man/parser.html
In addition, you can integrate syntax checking into your editor. Vim has built in code compilation functionality that can be used to run error checking, so you can quickly validate your code and jump to sections of code with syntax errors.
There are plugins like Syntastic that will do continuous checking so you're immediately alerted when syntax errors are made.
There's another tool called puppet-lint that could be used to serve the purpose