Rexx Tool To Check Coding Standards For Php

  

Rexx Tool To Check Coding Standards Template. 4/29/2017 0 Comments CBT Top 10 Files Updates Overflow JES3 JES2 CBT249 & Older UCLAmail Xmit Manager XMIT Viewers MVS 3. Overview This Rexx tool can be used for formatting and alignment of the JCL statements to follow JCL coding standards. To align the 'JOB','DD' and 'EXEC' statement in 10th column).

  1. Rexx Tool To Check Coding Standards Delphi. Is following the set of coding standards set prior. REXX /*REXX program computes the CRC. Pascal PHP Python SQL.
  2. Rexx is also a useful free tool to add to your coding toolbox. Having a powerful language you can code from memory for virtually any platform is very useful in today’s ever-changing IT environment.
  3. REXX Tips & Tricks:Sample source code. Jump to: navigation, search. ' will be introduced which result in a representation slightly greater or less than the value which is returned by standard C library functions (e.g. For example 0.5 decimal (1/2), which is 0.1 binary, should translate perfectly from one system to the.
depends on:
  • invoke during edit/view mode
  • invoke as a batch job
  • make corrections
  • just generate an error list
  • insert error messages

my experience with writing such tools is that i found writing it in COBOL or ASSEMBLER was easier, due to the probable required addition of additional checks.
also, what happens to the source after the check.

Bank Check Coding


I found that the only way to enforce programming standards was to introduce the 'check program' in the standard compile jcl and if deviations to the standards were found, insert error messages in the source file (without comment notation), before the compile step, so that the source could not be compiled.
without the ability to enforce standards, a second best method would be to write several REXX edit macros each having a specific job
  • would create the indentation required
  • flag unordered section/para names
  • flag improper Performs (not allow the thru option
  • flag goto's that were not to a para/section exit - eliminate potential permanent loops
  • flag IF's and EVALUATE's that exceeded 3-levels of nesting
  • modify code lines to insure only one verb and one reference per line - this helps with missing OF/IN's
  • program-id/pds member name mismatch

good 3rd party standards checkers cost quite a bit.
so, decide
  • what your standards are going to be
  • if you are really going to enforce standards
  • how you are going to enforce the standards

Standardsmy suggestion is a lot of REXX edit macros, each performing a single task, all CALLed from a Control EDIT Macro
or
write it in COBOL or ASSEMBLE or PL1, so that the program is easier to maintain.
I have nothing at all against REXX Scripts
(i have more than 800 in my personal library)
but something as complex as a source program standards checker
does not belong in one REXX script.
And, spend some time googling.
Active4 years, 11 months ago

I'm trying to find a tool to check for coding style in python.

For PHP I've seen there is the Code Sniffer, and a small perl script used by Drupal. Is there such a tool for python code?

NikiC
85.5k27 gold badges172 silver badges215 bronze badges
solarcsolarc
4,4202 gold badges32 silver badges49 bronze badges

closed as off-topic by Kevin Brown, Rizier123, gunr2171, ProgramFOX, durron597Jun 12 '15 at 14:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Kevin Brown, Rizier123, gunr2171, ProgramFOX, durron597
If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers

In the past I've mainly use PyLint - it can highlight when you used an undefined variable, when you import things without using them and so on.

It can be a bit verbose, complaining about things like lines being over 80 character long, variable not matching to specific regex's, classes having too few public methods, methods missing docs-trings.

For example, for script..

PyLint generates the following messages:

They are all valid complaints, but I tend to disable a lot of the convention and refactoring messages. You can disable specific messages, either as comments in your code:

..or as command line arguments to the PyLint command:

With the above messages disabled, it generates the following messages for the above code:

PyLint also generates a 'code report', including how many lines of code/comments/docstring/whitespace the file has, number of messages per-category, and gives your code a 'score' - 10 being no messages, 0 generally being a syntax error

Another option is PyFlakes, which I find a little less excessively-verbose (I've recently started using it in place of PyLint). Again using the above script, PyFlakes gives the following messages:

The final option I use is pep8.py, which as the name suggests enforces PEP8. It is by far the most.. pedantic script, enforcing things like correct blank-lines before/after functions/classes, spacing around code, correct 4-space indentation and so on..

Running on the code above, it produces the following:

It is mostly enforces stylistic things like correct whitespace, it does not do much static-analysis of the code like PyLint or PyFlakes, so I use pep8.py in conjunction with either PyLint or PyFlakes.

pep8.py was originally announced on the python mailing list here, but the download link in this is now dead.. There's a github mirror by cburroughs, with a few minor fixes at github.com/cburroughs/pep8.py, or you can grab the unmodified version from an older revision

PyChecker is another option, although I haven't use it

nicholaides
13.2k10 gold badges51 silver badges78 bronze badges
dbr

Coding Standards For Php

dbr
124k57 gold badges258 silver badges320 bronze badges

pylint and pyflakes would be a good start.

pylint in particular is very configurable, and you can enforce quite a few things with it.

Rexx Tool To Check Coding Standards For Phpnicholaides
13.2k10 gold badges51 silver badges78 bronze badges
David CournapeauDavid Cournapeau
60.4k7 gold badges57 silver badges67 bronze badges

Found this stackoverflow question while searching for a pep8 style enforcement tool when taking over an existing (legacy) project.

will automagically convert all the source code to confirm with pep8. Tried it on my legacy project and it works great. So I thought I would update this answer here in SO.

Calvin ChengCalvin Cheng
18.9k26 gold badges97 silver badges156 bronze badges

Theres a script called reindent.py thats sometimes included in your system's python distribution which will go through and re-indent all your code to the recommended 4 spaces indenting.

Heres a copy of it in case you can't find it in your distribution: http://www.koders.com/python/fid24D30FCD2CE388C67CB980EF55630D25970CFB96.aspx?s=cdef%3Aparser

priestcpriestc
14.9k17 gold badges65 silver badges103 bronze badges

Not the answer you're looking for? Browse other questions tagged pythoncoding-style or ask your own question.