Feature #36208

Move basic checks from Jenkins to Travis-CI

Added by Christian Trabold about 1 year ago. Updated 9 days ago.

Status:Needs Feedback Start date:2012-04-17
Priority:Should have Due date:2013-06-30
Assignee:Andy Grunwald % Done:

0%

Category:-
Target version:- Estimated time:4.00 hours
Votes: 0

Description

Move the basic checks from Jenkins to Travis-CI:

Check Commit-Message-Length

#!/bin/bash

echo "Check commit message..." 
git log -1 | awk -f commit-message-format.awk

Lint all changed file

#!/usr/bin/env ruby

require 'rubygems'
require 'rake'

puts "Check for PHP-Syntax errors..." 

files = `git diff --name-only HEAD HEAD^`
test_files = files.split.grep(/php|inc/)

#test_files = FileList['**/*.php'].exclude("adodb/","contrib/","openid/lib/","class.nusoap.php")
test_files.each do |f|
  begin
    if File.exists?(f)
      sh %{php -l #{f}}
    end
    rescue Exception
      puts "^----------------------------------------------------------------------------------" 
      puts "PHP Syntax error(s) detected. Please check this line to get a hint how to solve it!" 
      puts "File: #{f} - Last modified: #{File.mtime(f)}. Now: #{Time.now}" 
      puts "\n" 
      exit 1
  end
end

CodeSniff all commited files

#!/usr/bin/env ruby

require 'rubygems'
require 'rake'

puts "Running PHP Codesniffer..." 

files = `git diff --name-only HEAD HEAD^`
test_files = files.split.grep(/php|inc/)

begin
  system %Q{phpcs --sniffs=$PHPCS_SNIFFS -s -v --extensions=php,inc --ignore=$PHPCS_EXCLUDE --report=checkstyle --report-file=${WORKSPACE}/build/logs/checkstyle.xml #{test_files.join(" ")} 2>&1 | more}
rescue Exception
  puts "^----------------------------------------------------------------------------------" 
  puts "Violation(s) against TYPO3v4 Coding Guideline detected. Please check this line and the checkstyle report to get a hint how to solve it!" 
  puts "File: #{f} - Last modified: #{File.mtime(f)}. Now: #{Time.now}" 
  puts "\n" 
  exit 1
end

History

Updated by Christian Trabold about 1 year ago

  • Tracker changed from Bug to Feature

Updated by Christian Trabold 9 days ago

  • Due date changed from 2012-04-30 to 2013-06-30
  • Status changed from Accepted to Needs Feedback
  • Assignee changed from Christian Trabold to Andy Grunwald

Hi Andy,

wäre das Deiner Meinung nach immer noch sinnvoll?

Viele Grüße

Christian

Also available in: Atom PDF