sevntu-checkstyle / sevntu.checkstyle

Additional Checkstyle checks, that could be added as extension to EclipseCS plugin and maven-checkstyle-plugin, Sonar checkstyle plugin, extension for CheckStyle IDEA plugin.
http://sevntu-checkstyle.github.io/sevntu.checkstyle/
190 stars 147 forks source link

Issue #943: 'Bump CS version in REPO' is not working #954

Closed stoyanK7 closed 1 year ago

stoyanK7 commented 1 year ago

Resolves #943


Action: https://github.com/stoyanK7/sevntu.checkstyle/actions/runs/3613769860/jobs/6089744751 GitHub actions commit: https://github.com/stoyanK7/sevntu.checkstyle/commit/3decd875ef84fbf916890c667a88364bbe385108


rnveach commented 1 year ago

@romani see https://github.com/sevntu-checkstyle/sevntu.checkstyle/issues/943#issuecomment-1336203524 . That is the reason.

Is there any chance of asking eclipsecs to be in maven?

romani commented 1 year ago

Even dependabot service never compile target project. It simply update numbers in text file. We need same.

rnveach commented 1 year ago

Even dependabot service never compile target project.

I don't believe we are compiling, but doing version verification. I am not sure, this is all eclipse's process kicking off here.

dependatbot is not enabled for this POM because of this reason. I do not know if dependabot would have the same issues.

Either way, if you want to not do this then we will have to rely on manually parsing.

stoyanK7 commented 1 year ago

We can use xmlstarlet and do this. Though it removes empty lines as well.

xmlstarlet edit --inplace --update "/_:project/_:properties/_:checkstyle.version" --value "1.1.1" eclipsecs-sevntu-plugin/pom.xml
diff --git a/eclipsecs-sevntu-plugin/pom.xml b/eclipsecs-sevntu-plugin/pom.xml
index b1a3911a..90d2ad72 100644
--- a/eclipsecs-sevntu-plugin/pom.xml
+++ b/eclipsecs-sevntu-plugin/pom.xml
@@ -1,40 +1,32 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
   <modelVersion>4.0.0</modelVersion>
-
   <!-- we use eclipse-cs parent to ease our compilation and always be up-to-date -->
-
   <parent>
     <relativePath>../eclipse-pom.xml</relativePath>
     <groupId>com.github.sevntu-checkstyle</groupId>
     <artifactId>parent</artifactId>
     <version>1.44.0</version>
   </parent>
-
   <groupId>com.github.sevntu-checkstyle</groupId>
   <artifactId>eclipsecs-sevntu-plugin</artifactId>
   <packaging>eclipse-plugin</packaging>
-
   <name>eclipse-cs Sevntu Checkstyle Plugin</name>
-
   <licenses>
     <license>
       <name>LGPL-2.1+</name>
       <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
     </license>
   </licenses>
-
   <properties>
     <eclipsecs.version>10.4.0-SNAPSHOT</eclipsecs.version>
     <!-- verify time version -->
-    <checkstyle.version>10.4</checkstyle.version>
+    <checkstyle.version>1.1.1</checkstyle.version>
     <checkstyle.configLocation>https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle_c

Or sed

sed -i -e '/<properties>/,/<\/properties>/ s|<checkstyle.version>.*</checkstyle.version>|<checkstyle.version>1.1.1</checkstyle.version>|g' eclipsecs-sevntu-plugin/pom.xml 
diff --git a/eclipsecs-sevntu-plugin/pom.xml b/eclipsecs-sevntu-plugin/pom.xml
index b1a3911a..ede68465 100644
--- a/eclipsecs-sevntu-plugin/pom.xml
+++ b/eclipsecs-sevntu-plugin/pom.xml
@@ -28,7 +28,7 @@
   <properties>
     <eclipsecs.version>10.4.0-SNAPSHOT</eclipsecs.version>
     <!-- verify time version -->
-    <checkstyle.version>10.4</checkstyle.version>
+    <checkstyle.version>1.1.1</checkstyle.version>
     <checkstyle.configLocation>https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle_checks.xml</checkstyle.configLocation>
     <checkstyle.header>https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java.header</checkstyle.header>
     <checkstyle.regexp.header>https://raw.githubusercontent.com/checkstyle/checkstyle/master/config/java_regexp.header</checkstyle.regexp.header>
romani commented 1 year ago

Please use sed

stoyanK7 commented 1 year ago

Done.

Github actions commit: https://github.com/stoyanK7/sevntu.checkstyle/commit/825f0ad68900ea67cebce76ff2df1e66ded2a8b9 Job: https://github.com/stoyanK7/sevntu.checkstyle/actions/runs/3622733299/jobs/6107797231

coveralls commented 1 year ago

Coverage Status

Coverage remained the same at 98.798% when pulling 14974c7318778c29c46fc6c8b6bade2458791cf5 on stoyanK7:issue/943 into 6c68f1653c2d4af27270eaeb91c0955d1a7dd0b0 on sevntu-checkstyle:master.

stoyanK7 commented 1 year ago

Fixed small typo in filename that managed to slip away a few days ago,