DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
  • Auditing Tools for Kubernetes
  • Top 10 Pillars of Zero Trust Networks
  • Power BI Report by Pulling Data From SQL Tables

Trending

  • Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
  • Auditing Tools for Kubernetes
  • Top 10 Pillars of Zero Trust Networks
  • Power BI Report by Pulling Data From SQL Tables
  1. DZone
  2. Data Engineering
  3. Databases
  4. IntelliJ IDEA Knows How to Format Spock where: Blocks

IntelliJ IDEA Knows How to Format Spock where: Blocks

Hubert Klein Ikkink user avatar by
Hubert Klein Ikkink
·
Apr. 22, 13 · Interview
Like (1)
Save
Tweet
Share
5.64K Views

Join the DZone community and get the full member experience.

Join For Free

IntelliJ IDEA keeps amazing me. Last week I learned the code formatter of IntelliJ IDEA 12 supports Spock specific where: block formatting. Spock has great a great feature called data tables. We can define a fixed set of data values in a table-like format where cells are separated with pipe (|) symbols. These tables are easiest to read if formatted in fixed size columns. The IntelliJ IDEA formatter will do this for us automatically.

Look at the following source code with a data table just typed with pipe symbols as separators, but not clearly formatted in fixed size columns:


If we run the code reformat command with Cmd+Alt+L (Windows/Linux: Ctrl+Alt+L) or use the menu option Code | Reformat Code... we get a dialog and select Run button to format the code:


The result is that our data table in the where: block is now correctly formatted:


Example with IntelliJ IDEA 12.1

 

intellij Spock (testing framework) Blocks Database

Published at DZone with permission of Hubert Klein Ikkink, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
  • Auditing Tools for Kubernetes
  • Top 10 Pillars of Zero Trust Networks
  • Power BI Report by Pulling Data From SQL Tables

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: