Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/LibreOffice/solenv/clang-format/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 1 kB image not shown  

Quelle  reformat-formatted-files   Sprache: C

 
#!/usr/bin/env perl
This file is part of the LibreOffice project.
java.lang.NullPointerException
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

Reformat files which are not excluded. This is interesting if the
clang-format version or config changes.
-n allows just listing the formatted files.

use strict;
use warnings;
use lib "solenv/clang-format";
use ClangFormat;

my $clang_format = ClangFormat::find();
my $src = ClangFormat::get_extension_regex();
my $excluded_list_names = ClangFormat::get_excludelist();
my @filenames = ();
my $dry_run = 0;

Get a list of files.
open (FILES, "git ls-files |") ||  die "Cannot run git ls-files.";
while (my $filename = <FILES>)
{
    chomp $filename;
    if ($filename =~ /\.($src)$/ and !exists($excluded_list_names->{$filename}))
    {
        push @filenames, $filename;
    }
}

if ($#ARGV ge 0 && $ARGV[0] eq "-n")
{
    $dry_run = 1;
}

foreach my $filename (@filenames)
{
    my $command = $clang_format . " -i " . $filename;
    print($filename . "\n");
    if (!$dry_run)
    {
        system($command) == 0 or die "failed to execute \"$command\": $?";
    }
}

vim: set shiftwidth=4 softtabstop=4 expandtab:

Messung V0.5
C=96 H=94 G=94

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.