That user must be a member of the Team Foundation Server Valid Users group. When the value of the State field for a work item is set to Active and the work item is saved, the values of the Activated By and Assigned To fields are automatically set to the name of the current user. :::image type="content" source="media/sample-rules/make-remaining-work-required-for-task.png" alt-text="Screenshot of custom rule to make Remaining Work required when State is changed to Active."::: On-premises XML process The following example shows how you can require specification of the Remaining Work field when the task workflow State changes to Active. Integer estimate of overall size for work to be done Automatically fill in based on Tee-Shirt Size. You use a series of WHEN rule statements to make the mapping, setting the value of the Size field using the COPY value="value" rule.Įstimate of overall size for work to be done Small (2), Medium (6), Large (18), X-Large (30). You specify the value of the Size field in the FIELDS section of the work item type definition. :::image type="content" source="media/sample-rules/four-custom-tee-shirt-size-mapping-rules.png" alt-text="Screenshot of four custom rule to set Size value when Tee-Shirt Size is set."::: On-premises XML process :::image type="content" source="media/sample-rules/set-tshirt-size-small-rule.png" alt-text="Screenshot of custom rule to set Size value when Tee-Shirt Size is set to Small."::: :::image type="content" source="media/sample-rules/tee-shirt-size-edit-field-dialog.png" alt-text="Screenshot of Edit field dialog for Tee-Shirt Size field."::: To simplify usage, the default value of the Tee-Shirt Size is Small.Įdit field dialog for Tee-Shirt Size field Four custom rules are defined to assign the Size field when the Tee-Shirt Size field is changed to a specific value. The Tee-Shirt Size pick-list consists of four values Small, Medium, Large, and X-Large. The following examples illustrate how to map the values of the Size field depending on the value selected for the custom field, Tee-Shirt Size field. The size of work estimated for implementing this user story You specify a WHEN rule statement for the field definition within the FIELDS section of the work item type definition. :::image type="content" source="media/sample-rules/set-severity-customer-reported-true.png" alt-text="Screenshot of custom rule to make Severity required when Customer REported field=true."::: On-premises XML process If the issue isn't reported by a customer, a value for the Severity field isn't required. In the following example, when a customer reports an issue, the custom Customer Reported field is set to True, and the Severity field becomes required. You can specify that a field is required only when another field contains a specific value. Prior to adding custom rules, read Rules and rule evaluation and Add a rule to a work item type (Inheritance process). ![]() Examples are provided for both the Inherited and On-premises XML process models. All custom rules are defined for a work item type. I think there is no reason not to pass sonar.projectKey / sonar.projectName to the configuration object.This article provides examples of custom rule definitions. This is an inconsistency because in connected mode SonarLint already konws the true sonar.projectKey and sonar.projectName but these properties are being ignored when analysis properties are being merged or being calculated (, target / source versions, etc …).Īnd worse, even when i configure sonar.projectKey, invoking JavaFileScannerContext.getProject (). So, in order to know the projectKey in the context of a rule execution the only solution we have nowadays is that the user MUST configure again and manually the sonar.projectKey in the SonarLint preferences / analysis properties page. ![]() Key (), the method returns “sonarlint” instead the real projectKey. ![]() I found especially frustrating the first one.Īt runtime, if we call in a rule to JavaFileScannerContext.getProject (). Properties “sonar.projectKey” and “sonar.projectName” are not being passed as analysis settings. ![]() I’m reading this message and i would like to comment somthing about what you said: “in connected mode, all analysis settings comes from the project’s configuration on the server side” The following screenshot is the Sonarlint configuration UI in Eclipse To do the whole compilation and packaging work. What I have done so far is that I have activated SonarLint support via changing pom.xml of alpha, and have used -> mvn clean install -U We have created a plugin which includes a bunch of Sonar Java custom rules for alpha, called alpha-custom-java-rules, and right now I would like to apply these rules to SonarLint. Our project is a multi-module Maven project, called alpha, and the IDE we use is Eclipse/IntelliJ. We plan to use SonarLint to detect and fix quality issues of our project.
0 Comments
Leave a Reply. |